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 Option
- func WithBodySource(source *body.Source) Option
- func WithCookies(values map[string]string) Option
- func WithForm(values url.Values) Option
- func WithHeaders(values http.Header) Option
- func WithIgnoreEmptyQueryParameters(ignore bool) 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) WithHeader(name, value string) *Scope
Constants ¶
View Source
const ( QueryKind = "query" PathKind = "path" HeaderKind = "header" CookieKind = "cookie" FormKind = "form" BodyKind = "body" HTTPRequestKind = "http_request" )
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 Option ¶
type Option func(*Scope)
func WithBodySource ¶
func WithCookies ¶
func WithHeaders ¶
func WithIgnoreEmptyQueryParameters ¶
WithIgnoreEmptyQueryParameters treats a single empty query value as absent. Repeated values and other provider kinds retain their authored presence.
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 (*Scope) WithHeader ¶
WithHeader returns a detached header overlay. The underlying request pointer and all other source values retain their invocation identity.
Click to show internal directories.
Click to hide internal directories.