Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrArgument = errors.New("argument error") ErrAuthentication = errors.New("authentication error") ErrAuthorization = errors.New("authorization error") ErrCommunication = errors.New("communication error") ErrCommunicationTimeout = errors.New("communication timeout error") ErrConfiguration = errors.New("configuration error") ErrInternal = errors.New("internal error") ErrNoRuleFound = errors.New("no rule found") )
Functions ¶
This section is empty.
Types ¶
type Headers ¶ added in v0.17.21
type Headers struct {
// contains filtered or unexported fields
}
Headers provides a read-only, lazily normalized view on HTTP headers.
The underlying http.Header is neither copied nor modified. It must therefore not be mutated for the lifetime of Headers.
Header values are normalized on first access. If multiple values exist for a header, they are joined using a comma. The normalized value is cached and reused for subsequent accesses using the same header name.
Headers is request-scoped and not safe for concurrent use.
func NewHeaders ¶ added in v0.17.21
NewHeaders creates a read-only view on the supplied HTTP headers.
No headers are copied or normalized when this function is called.
func (*Headers) Get ¶ added in v0.17.21
Get returns the normalized value associated with name.
Header names are matched case-insensitively.
If no value exists, an empty string is returned. A single value is returned unchanged. Multiple values are joined using a comma.
The result is cached on first access and reused for subsequent accesses using the same header name.
type RedirectError ¶
func (*RedirectError) Error ¶
func (e *RedirectError) Error() string
func (*RedirectError) Is ¶
func (e *RedirectError) Is(target error) bool
type Request ¶
type Request struct {
RequestFunctions
Method string
URL *URL
ClientIPAddresses []string
}
type RequestContext ¶ added in v0.16.0
type RequestFunctions ¶
type Result ¶ added in v0.17.21
type Result struct {
Payload any
// contains filtered or unexported fields
}
Result represents the result produced by a pipeline step.
Payload is directly available to templates and CEL expressions.
Response headers are intentionally not exposed as a mutable collection. They can only be accessed through Header.
func NewResultWithHeaders ¶ added in v0.17.21
NewResultWithHeaders creates a result containing a payload and HTTP response headers.
The supplied headers are not copied or modified. They must therefore not be mutated for the lifetime of the result.
func (*Result) Header ¶ added in v0.17.21
Header returns the value associated with the given header name.
Its semantics intentionally match Request.Header:
- a missing header results in an empty string;
- a single value is returned as-is;
- multiple values are returned as a comma-separated string.
Header values are normalized lazily and cached by Headers.