api

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const CacheGetPath = "/{any:*}"

CacheGetPath for getting pagedata from cache via HTTP.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheProxyController

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

CacheProxyController handles cache API requests (read/write-through, error reporting, metrics).

func NewCacheProxyController

func NewCacheProxyController(
	ctx context.Context,
	cfg config.Config,
	cache storage.Storage,
	backend upstream.Upstream,
) *CacheProxyController

NewCacheProxyController builds a cache API controller with all dependencies. If debug is enabled, launches internal stats logger goroutine.

func (*CacheProxyController) AddRoute

func (c *CacheProxyController) AddRoute(router *router.Router)

AddRoute attaches controller's route(s) to the provided router.

func (*CacheProxyController) Index

func (c *CacheProxyController) Index(rCtx *fasthttp.RequestCtx)

Index is the main HTTP handler.

type ChangeBackendPolicyController

type ChangeBackendPolicyController struct {
}

func NewChangeBackendPolicyController

func NewChangeBackendPolicyController() *ChangeBackendPolicyController

func (*ChangeBackendPolicyController) AddRoute

func (*ChangeBackendPolicyController) ShowPolicy added in v1.7.0

func (*ChangeBackendPolicyController) TurnOnAwaitPolicy

func (c *ChangeBackendPolicyController) TurnOnAwaitPolicy(ctx *fasthttp.RequestCtx)

func (*ChangeBackendPolicyController) TurnOnDenyPolicy

func (c *ChangeBackendPolicyController) TurnOnDenyPolicy(ctx *fasthttp.RequestCtx)

type ClearController

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

func NewClearController

func NewClearController(cfg config.Config, db storage.Storage) *ClearController

func (*ClearController) AddRoute

func (c *ClearController) AddRoute(r *router.Router)

func (*ClearController) HandleClear

func (c *ClearController) HandleClear(ctx *fasthttp.RequestCtx)

HandleClear is mounted at GET /cache/clear. Without ?token, returns a valid token (5min TTL). With ?token, validates, clears storage, logs, and returns status.

type ClearOneController

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

func NewMarkOutdatedController

func NewMarkOutdatedController(cfg config.Config, db storage.Storage) *ClearOneController

func (*ClearOneController) AddRoute

func (c *ClearOneController) AddRoute(r *router.Router)

func (*ClearOneController) Invalidate added in v1.7.0

func (c *ClearOneController) Invalidate(ctx *fasthttp.RequestCtx)

type ForceGCController added in v1.7.0

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

func NewForceGCController added in v1.7.0

func NewForceGCController() *ForceGCController

func (*ForceGCController) AddRoute added in v1.7.0

func (c *ForceGCController) AddRoute(r *router.Router)

func (*ForceGCController) ForceGC added in v1.7.0

func (c *ForceGCController) ForceGC(ctx *fasthttp.RequestCtx)

type GetController added in v1.8.0

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

func NewGetController added in v1.8.0

func NewGetController(db storage.Storage) *GetController

func (*GetController) AddRoute added in v1.8.0

func (c *GetController) AddRoute(r *router.Router)

func (*GetController) Get added in v1.8.0

func (c *GetController) Get(ctx *fasthttp.RequestCtx)

type HttpCompressionController

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

func NewHttpCompressionController

func NewHttpCompressionController() *HttpCompressionController

func (*HttpCompressionController) AddRoute

func (c *HttpCompressionController) AddRoute(r *router.Router)

func (*HttpCompressionController) Get

func (*HttpCompressionController) Off

func (*HttpCompressionController) On

type OnOffController

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

OnOffController provides endpoints to switch the advanced cache on and off.

func NewOnOffController

func NewOnOffController(cfg config.Config) *OnOffController

NewOnOffController creates a new OnOffController instance.

func (*OnOffController) AddRoute

func (c *OnOffController) AddRoute(r *router.Router)

AddRoute attaches the on/off routes to the given router.

func (*OnOffController) BypassIs added in v1.7.0

func (c *OnOffController) BypassIs(ctx *fasthttp.RequestCtx)

func (*OnOffController) Off

func (c *OnOffController) Off(ctx *fasthttp.RequestCtx)

Off handles POST /adv-cache/off and disables the advanced cache, returning JSON.

func (*OnOffController) On

func (c *OnOffController) On(ctx *fasthttp.RequestCtx)

On handles POST /adv-cache/on and enables the advanced cache, returning JSON.

type ShowConfigController added in v1.7.0

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

func NewShowConfigController added in v1.7.0

func NewShowConfigController(cfg config.Config) *ShowConfigController

func (*ShowConfigController) AddRoute added in v1.7.0

func (c *ShowConfigController) AddRoute(r *router.Router)

func (*ShowConfigController) ShowConfig added in v1.7.0

func (c *ShowConfigController) ShowConfig(ctx *fasthttp.RequestCtx)

Jump to

Keyboard shortcuts

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