Help us shape the future of Go! Take the 2026 Go Developer Survey

context

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 15 Imported by: 11

Documentation

Index

Constants

View Source
const (
	CacheName           ctxKey = "souin_ctx.CACHE_NAME"
	RequestCacheControl ctxKey = "souin_ctx.REQUEST_CACHE_CONTROL"
)
View Source
const (
	GraphQL           ctxKey = "souin_ctx.GRAPHQL"
	HashBody          ctxKey = "souin_ctx.HASH_BODY"
	IsMutationRequest ctxKey = "souin_ctx.IS_MUTATION_REQUEST"
)
View Source
const (
	Key            ctxKey = "souin_ctx.CACHE_KEY"
	DisplayableKey ctxKey = "souin_ctx.DISPLAYABLE_KEY"
	IgnoredHeaders ctxKey = "souin_ctx.IGNORE_HEADERS"
	Hashed         ctxKey = "souin_ctx.HASHED"
)
View Source
const (
	TimeoutCache  ctxKey = "souin_ctx.TIMEOUT_CACHE"
	TimeoutCancel ctxKey = "souin_ctx.TIMEOUT_CANCEL"
)
View Source
const CacheControlCtx ctxKey = "souin_ctx.CACHE-CONTROL-CTX"
View Source
const Mode ctxKey = "souin_ctx.MODE"
View Source
const Now ctxKey = "souin_ctx.NOW"
View Source
const SupportedMethod ctxKey = "souin_ctx.SUPPORTED_METHOD"

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	CacheName ctx
	GraphQL   ctx
	Key       ctx
	Method    ctx
	Mode      ctx
	Now       ctx
	Timeout   ctx
}

func GetContext

func GetContext() *Context

func (*Context) Init

func (*Context) SetBaseContext added in v1.6.14

func (c *Context) SetBaseContext(req *http.Request) *http.Request

func (*Context) SetContext

func (c *Context) SetContext(req *http.Request, baseRq *http.Request) *http.Request

type ModeContext added in v1.6.39

type ModeContext struct {
	Strict, Bypass_request, Bypass_response bool
}

func (*ModeContext) SetContext added in v1.6.39

func (mc *ModeContext) SetContext(req *http.Request) *http.Request

func (*ModeContext) SetContextWithBaseRequest added in v1.6.45

func (*ModeContext) SetContextWithBaseRequest(req *http.Request, _ *http.Request) *http.Request

func (*ModeContext) SetupContext added in v1.6.39

Jump to

Keyboard shortcuts

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