origin

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(mapCfg *config.Mapping)

func ProduceCache

func ProduceCache(ctx *fasthttp.RequestCtx, ca cache.Cache, header []byte, body []byte)

ProduceCache TODO: process header/body in pkg `cache`

func SelectRandomNode

func SelectRandomNode(origin *config.OriginSource) (string, error)

Types

type Mapping

type Mapping struct {
	config.Mapping
	DomainMap map[string]*config.Domain
	OriginMap map[string]*config.OriginSource
}

type Origin

type Origin struct {
	// contains filtered or unexported fields
}
var DefaultOrigin *Origin

func NewOrigin

func NewOrigin(mapCfg *config.Mapping, ca cache.Cache) *Origin

func (*Origin) ServeProxyHTTP

func (o *Origin) ServeProxyHTTP(ctx *fasthttp.RequestCtx)

ServeProxyHTTP TODO: high performance tuning with `fasthttp`

Jump to

Keyboard shortcuts

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