Documentation
¶
Overview ¶
Package request composes independently scoped HTTP value providers while preserving the original request pointer for handler capabilities.
Index ¶
- Constants
- func WithQueryPolicy(ctx context.Context, policy QueryPolicy) context.Context
- type Decoder
- type DecoderFunc
- type DecoderRegistry
- type FieldDecoder
- type Option
- func WithBodySource(source *body.Source) Option
- func WithCookies(values map[string]string) Option
- func WithDecoder(mediaType string, decoder Decoder) Option
- func WithForm(values url.Values) Option
- func WithHeaders(values http.Header) Option
- func WithIgnoreEmptyQueryParameters(ignore bool) Option
- func WithMaxMultipartMemory(size int64) Option
- func WithPathParams(values map[string]string) Option
- func WithQuery(values url.Values) Option
- type QueryPolicy
- type Scope
- func (s *Scope) Body() *body.Source
- func (s *Scope) Close() error
- func (s *Scope) Cookie() locator.Provider
- func (s *Scope) Form() locator.Provider
- func (s *Scope) Header() locator.Provider
- func (s *Scope) Path() locator.Provider
- func (s *Scope) Providers() []locator.Provider
- func (s *Scope) Query() locator.Provider
- func (s *Scope) Request() locator.Provider
- func (s *Scope) WithHeader(name, value string) *Scope
Constants ¶
const ( QueryKind = "query" PathKind = "path" HeaderKind = "header" CookieKind = "cookie" FormKind = "form" BodyKind = "body" HTTPRequestKind = "http_request" RequestKind = HTTPRequestKind )
Variables ¶
This section is empty.
Functions ¶
func WithQueryPolicy ¶
func WithQueryPolicy(ctx context.Context, policy QueryPolicy) context.Context
WithQueryPolicy overrides scope defaults for this invocation only.
Types ¶
type DecoderFunc ¶ added in v0.3.0
type DecoderFunc = body.DecoderFunc
type DecoderRegistry ¶ added in v0.3.0
type DecoderRegistry = body.DecoderRegistry
func NewDecoderRegistry ¶ added in v0.3.0
func NewDecoderRegistry() *DecoderRegistry
type FieldDecoder ¶ added in v0.3.0
type FieldDecoder = body.FieldDecoder
type Option ¶
type Option func(*Scope)
func WithBodySource ¶
func WithCookies ¶
func WithDecoder ¶ added in v0.3.0
func WithHeaders ¶
func WithIgnoreEmptyQueryParameters ¶
WithIgnoreEmptyQueryParameters treats a single empty query value as absent. Repeated values and other provider kinds retain their authored presence.
func WithMaxMultipartMemory ¶ added in v0.3.0
func WithPathParams ¶
type QueryPolicy ¶
type QueryPolicy struct{ IgnoreEmptyParameters bool }
QueryPolicy is invocation-local query presence policy.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
func NewDeferred ¶ added in v0.4.0
NewDeferred opts this invocation into demand-driven body/form initialization. New retains its eager construction and option timing. Metadata providers do not read bytes; the full raw-request capability snapshots and rewinds them.
func (*Scope) WithHeader ¶
WithHeader returns a detached header overlay. The underlying request pointer and all other source values retain their invocation identity.