proxy

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CHtos = map[CustomHeaders]string{
	CHCacheKeyOverride: "X-CacheKey-Override",
	CHCacheKeyPrefix:   "X-CacheKey-Prefix",
	CHCacheKeySuffix:   "X-CacheKey-Suffix",
	CHCacheBypass:      "X-Cache-Bypass",
}
View Source
var Stoch = map[string]CustomHeaders{
	"X-CacheKey-Override": CHCacheKeyOverride,
	"X-CacheKey-Prefix":   CHCacheKeyPrefix,
	"X-CacheKey-Suffix":   CHCacheKeySuffix,
	"X-Cache-Bypass":      CHCacheBypass,
}

Functions

func ReleaseKey

func ReleaseKey(key *Key)

func ReleaseValidator added in v1.0.6

func ReleaseValidator(v *Validator)

Types

type CustomHeaders added in v1.0.2

type CustomHeaders uint8
const (
	CHCacheKeyOverride CustomHeaders = 1 << iota
	CHCacheKeyPrefix
	CHCacheKeySuffix
	CHCacheBypass
)

type Key

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

func AcquireKey

func AcquireKey() *Key

func (*Key) Bytes

func (m *Key) Bytes() []byte

func (*Key) Len added in v1.0.2

func (m *Key) Len() int

func (*Key) Put

func (m *Key) Put(key []byte)

func (*Key) Reset

func (m *Key) Reset()

func (*Key) UnsafeHeadersKey added in v1.0.15

func (m *Key) UnsafeHeadersKey() string

func (*Key) UnsafeString

func (m *Key) UnsafeString() string

type Proxy

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

func NewProxy

func NewProxy(c context.Context) *Proxy

func (*Proxy) HandleCacheDump added in v1.0.2

func (m *Proxy) HandleCacheDump(c *fiber.Ctx) (e error)

func (*Proxy) HandleCacheDumpKeys added in v1.0.2

func (m *Proxy) HandleCacheDumpKeys(c *fiber.Ctx) (_ error)

func (*Proxy) HandleCachePurge added in v1.0.2

func (m *Proxy) HandleCachePurge(c *fiber.Ctx) (e error)

func (*Proxy) HandleCachePurgeAll added in v1.0.2

func (m *Proxy) HandleCachePurgeAll(c *fiber.Ctx) (e error)

func (*Proxy) HandleCacheStats added in v1.0.2

func (m *Proxy) HandleCacheStats(c *fiber.Ctx) (_ error)

func (*Proxy) HandleCacheStatsReset added in v1.0.2

func (m *Proxy) HandleCacheStatsReset(c *fiber.Ctx) (e error)

func (*Proxy) HandleProxyToCache

func (m *Proxy) HandleProxyToCache(c *fiber.Ctx) (e error)

func (*Proxy) HandleProxyToDst

func (m *Proxy) HandleProxyToDst(c *fiber.Ctx) (e error)

func (*Proxy) HandleRandomRelease added in v1.0.10

func (m *Proxy) HandleRandomRelease(c *fiber.Ctx) (e error)

func (*Proxy) IsCacheBypass added in v1.0.2

func (*Proxy) IsCacheBypass(c *fiber.Ctx) bool

func (*Proxy) IsRequestCached

func (m *Proxy) IsRequestCached(c *fiber.Ctx) (ok bool)

func (*Proxy) MiddlewareInternalApi added in v1.0.2

func (m *Proxy) MiddlewareInternalApi(c *fiber.Ctx) (_ error)

func (*Proxy) MiddlewareValidation

func (m *Proxy) MiddlewareValidation(c *fiber.Ctx) (e error)

func (*Proxy) ProxyCachedRequest

func (m *Proxy) ProxyCachedRequest(c *fiber.Ctx) (e error)

func (*Proxy) ProxyFiberRequest

func (m *Proxy) ProxyFiberRequest(c *fiber.Ctx) (e error)

type ProxyClient

type ProxyClient struct {
	*fasthttp.HostClient
}

func NewClient

func NewClient(c *cli.Context) *ProxyClient

type ProxyConfig

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

type Validator

type Validator struct {
	*fiber.Ctx
	// contains filtered or unexported fields
}

func AcquireValidator added in v1.0.6

func AcquireValidator(c *fiber.Ctx, ctr []byte) (v *Validator)

func (*Validator) IsQueryEqual added in v1.0.10

func (m *Validator) IsQueryEqual(equal []byte) bool

func (*Validator) Reset added in v1.0.6

func (m *Validator) Reset()

func (*Validator) ValidateRequest

func (m *Validator) ValidateRequest() (e error)

Jump to

Keyboard shortcuts

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