Documentation
¶
Index ¶
- Constants
- type CacheProxyController
- type ChangeBackendPolicyController
- func (c *ChangeBackendPolicyController) AddRoute(r *router.Router)
- func (c *ChangeBackendPolicyController) ShowPolicy(ctx *fasthttp.RequestCtx)
- func (c *ChangeBackendPolicyController) TurnOnAwaitPolicy(ctx *fasthttp.RequestCtx)
- func (c *ChangeBackendPolicyController) TurnOnDenyPolicy(ctx *fasthttp.RequestCtx)
- type ClearController
- type ClearOneController
- type ForceGCController
- type HttpCompressionController
- type OnOffController
- type ShowConfigController
Constants ¶
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(ctx *fasthttp.RequestCtx)
Index is the main HTTP handler.
type ChangeBackendPolicyController ¶
type ChangeBackendPolicyController struct {
}
func NewChangeBackendPolicyController ¶
func NewChangeBackendPolicyController() *ChangeBackendPolicyController
func (*ChangeBackendPolicyController) AddRoute ¶
func (c *ChangeBackendPolicyController) AddRoute(r *router.Router)
func (*ChangeBackendPolicyController) ShowPolicy ¶ added in v1.7.0
func (c *ChangeBackendPolicyController) ShowPolicy(ctx *fasthttp.RequestCtx)
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 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 (c *HttpCompressionController) Get(ctx *fasthttp.RequestCtx)
func (*HttpCompressionController) Off ¶
func (c *HttpCompressionController) Off(ctx *fasthttp.RequestCtx)
func (*HttpCompressionController) On ¶
func (c *HttpCompressionController) On(ctx *fasthttp.RequestCtx)
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)