httpcontext

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value[T any] struct {
	Key any
}

Value is used to lookup values stored in context.Context.

func NewValue

func NewValue[T any](key any) *Value[T]

NewValue creates a new value.

func (*Value[T]) Get

func (v *Value[T]) Get(r *http.Request) T

Get returns a value bound to a request context.

func (*Value[T]) GetContext

func (v *Value[T]) GetContext(ctx context.Context) (res T)

GetContext returns a value bound to a context.

func (*Value[T]) Set

func (v *Value[T]) Set(r *http.Request, val T)

Set will update a context value in the passed request.

func (*Value[T]) SetContext

func (v *Value[T]) SetContext(ctx context.Context, val T) context.Context

Jump to

Keyboard shortcuts

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