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

attributes

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PsrContextKey is a context key. It can be used in the http attributes
	// immutable
	PsrContextKey = &contextKey{"psr_attributes"} //nolint:gochecknoglobals
)

Functions

func All

func All(r *http.Request) map[string]interface{}

All returns all context attributes.

func Get

func Get(r *http.Request, key string) interface{}

Get gets the value from request context. It replaces any existing values.

func Init

func Init(r *http.Request) *http.Request

Init returns request with new context and attribute bag.

func Set

func Set(r *http.Request, key string, value interface{}) error

Set sets the key to value. It replaces any existing values. Context specific.

Types

This section is empty.

Jump to

Keyboard shortcuts

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