Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextValueExtractor ¶
ContextValueExtractor returns a gum.Extractor that extracts a value of type T from the context.Context that was previous provided using ProvideContextValue.
Types ¶
type ContentLength ¶
type ContentLength int64
ContentLength is the value of the Content-Length header. Only available if the value requests value is not negative.
type ContentType ¶
type ContentType string
ContentType holds the value of the requests Content-Type header.
type ContextValue ¶
type ContextValue[T any] struct { Value T }
ContextValue uses the type T as the key to lookup a value of type T in the requests context.Context. Use WithContextValue to get a http.Handler middleware that injects a value into the context.Context
func (ContextValue[T]) FromRequest ¶
func (ContextValue[T]) FromRequest(r *http.Request) (ContextValue[T], error)
type Method ¶
type Method string
Method is the value of the requests Method field, e.g. GET, POST, etc
type Middleware ¶
func ProvideContextValue ¶
func ProvideContextValue[T any](value T) Middleware
ProvideContextValue provides a Middleware that injects a value of type T into the requests context. The value can later be extracted by using ContextValue.
type MultipartFormMaxMemory ¶
type MultipartFormMaxMemory int64
type Option ¶
Option is similar to Try, it just swallows any error.