heimdall

package
v0.17.21 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func NewHeaders(values http.Header) Headers

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

func (h *Headers) Get(name string) string

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

type RedirectError struct {
	Message    string
	Code       int
	RedirectTo string
}

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 RequestContext interface {
	Request() *Request

	AddHeaderForUpstream(name, value string)
	AddCookieForUpstream(name, value string)

	Context() context.Context

	SetPipelineError(err error)

	Outputs() map[string]any
	Results() Results
}

type RequestFunctions

type RequestFunctions interface {
	Header(name string) string
	Cookie(name string) string
	Headers() map[string]string
	Body() any
}

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 NewResult added in v0.17.21

func NewResult(payload any) *Result

NewResult creates a result containing a payload.

func NewResultWithHeaders added in v0.17.21

func NewResultWithHeaders(payload any, headers http.Header) *Result

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

func (r *Result) Header(name string) string

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.

func (*Result) MarshalJSON added in v0.17.21

func (r *Result) MarshalJSON() ([]byte, error)

func (*Result) UnmarshalJSON added in v0.17.21

func (r *Result) UnmarshalJSON(data []byte) error

type Results added in v0.17.21

type Results map[string]*Result

Results contains the results produced by executed pipeline steps.

type URL

type URL struct {
	url.URL

	Captures map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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