lrucache

package module
v0.0.0-...-b705287 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

go-caddy-lru-cache

just for testing caddy modules

go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
xcaddy build  --with github.com/9glt/go-caddy-lru-cache

Caddyfile

http://*:1200 {

	route {
		tscache .ts
		reverse_proxy http://127.0.0.1
	}
}
./caddy run

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomResponse

type CustomResponse struct {
	Body       []byte
	Header     http.Header
	Len        int
	StatusCode int
}

type Middleware

type Middleware struct {
	// The file or stream to write to. Can be "stdout"
	// or "stderr".
	Output string `json:"output,omitempty"`
	// contains filtered or unexported fields
}

Middleware implements an HTTP handler that writes the visitor's IP address to a file or stream.

func (Middleware) CaddyModule

func (Middleware) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Middleware) Provision

func (m *Middleware) Provision(ctx caddy.Context) error

Provision implements caddy.Provisioner.

func (Middleware) ServeHTTP

func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

func (*Middleware) UnmarshalCaddyfile

func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

func (*Middleware) Validate

func (m *Middleware) Validate() error

Validate implements caddy.Validator.

type RW

type RW struct {
	Bytes  *bytes.Buffer
	W      http.ResponseWriter
	Code   int
	H      http.Header
	Status int
	// contains filtered or unexported fields
}

func (RW) Header

func (rw RW) Header() http.Header

func (RW) Write

func (rw RW) Write(b []byte) (int, error)

func (RW) WriteHeader

func (rw RW) WriteHeader(status int)

Directories

Path Synopsis
Package lru provides three different LRU caches of varying sophistication.
Package lru provides three different LRU caches of varying sophistication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL