proxies

package
v0.0.0-...-43ff40c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ServerToken = "hitori-cache-server"

Variables

This section is empty.

Functions

func Init

func Init(config *config.Config)

func Serve

func Serve() error

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}
var DefaultProxy *Proxy

func NewProxy

func NewProxy(port int, ca cache.Cache, ori *origin.Origin) *Proxy

NewProxy TODO: use buildOption to support complex proxies settings

func (*Proxy) ListenAddr

func (p *Proxy) ListenAddr() string

func (*Proxy) ProxyHandler

func (p *Proxy) ProxyHandler(ctx *fasthttp.RequestCtx)

func (*Proxy) PurgeCache

func (p *Proxy) PurgeCache(ctx *fasthttp.RequestCtx) error

func (*Proxy) Serve

func (p *Proxy) Serve() error

func (*Proxy) ServeByCache

func (p *Proxy) ServeByCache(ctx *fasthttp.RequestCtx) error

func (*Proxy) ServeByOrigin

func (p *Proxy) ServeByOrigin(ctx *fasthttp.RequestCtx) error

func (*Proxy) ServeMux

func (p *Proxy) ServeMux(ctx *fasthttp.RequestCtx) error

ServeMux a muxer to decide which source(origin/cache) to serve client

Jump to

Keyboard shortcuts

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