proxy

package
v0.0.0-...-775d5b3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyHeader

func CopyHeader(dst, src http.Header)

func Key

func Key(in *url.URL) (requestPath, cacheKey string)

Types

type FileSystemUpstream

type FileSystemUpstream struct {
	// contains filtered or unexported fields
}

func NewFileSystemUpstream

func NewFileSystemUpstream(fs fs.FS) *FileSystemUpstream

func (*FileSystemUpstream) Get

func (up *FileSystemUpstream) Get(requestPath, cacheKey string) (cachedResponse, error)

type HTTPUpstream

type HTTPUpstream struct {
	// contains filtered or unexported fields
}

func NewHTTPUpstream

func NewHTTPUpstream(origin, cacheRoot string) *HTTPUpstream

func (*HTTPUpstream) Get

func (s *HTTPUpstream) Get(requestPath, cacheKey string) (cachedResponse, error)

type Server

type Server struct {
	Upstream
}

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ServerOptions

type ServerOptions struct {
	UpstreamPrefix string
	CaptureRoot    string
}

type Upstream

type Upstream interface {
	Get(requestPath, cacheKey string) (cachedResponse, error)
}

Jump to

Keyboard shortcuts

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