context

package
v0.0.0-...-ef4fc8a Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 10 Imported by: 0

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"
)
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

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

type ModeContext struct {
	Strict, Bypass_request, Bypass_response bool
}

func (*ModeContext) SetContext

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

func (*ModeContext) SetContextWithBaseRequest

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

func (*ModeContext) SetupContext

Jump to

Keyboard shortcuts

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