ctx

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	Setter
	Getter
}

func NewContext

func NewContext(m map[string]any) Context

func NewStructContext

func NewStructContext(obj interface{}) Context

type Editor

type Editor interface {
	EditContext(key string, context Context)
}

type Getter

type Getter interface {
	Get(key string) any
}

type HTTPRequestContext

type HTTPRequestContext struct {
	*StructContext
	HttpRequest *http.Request
	CsrfToken   string
}

func RequestContext

func RequestContext(r *http.Request) *HTTPRequestContext

func (*HTTPRequestContext) CSRFToken

func (c *HTTPRequestContext) CSRFToken() string

func (*HTTPRequestContext) Request

func (c *HTTPRequestContext) Request() *http.Request

type Setter

type Setter interface {
	Set(key string, value any)
}

type StructContext

type StructContext struct {
	DeniesContext bool
	// contains filtered or unexported fields
}

func (*StructContext) Get

func (c *StructContext) Get(key string) any

func (*StructContext) Object

func (c *StructContext) Object() interface{}

func (*StructContext) Set

func (c *StructContext) Set(key string, value any)

Jump to

Keyboard shortcuts

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