composer

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MetaKeyOrder = "order"
)

Variables

This section is empty.

Functions

func DebugFromContext added in v1.0.0

func DebugFromContext(ctx context.Context) debug.Call

DebugFromContext returns the debug call from the context, or a noop call if none is found.

Types

type Composer added in v0.8.0

type Composer interface {
	http.Handler
	adminext.FlowFetcher
}

Composer is an http.Handler that exposes metadata about its FlowComponent chain.

func New

func New(opts *Opts) Composer

type ContextKey added in v0.8.0

type ContextKey string
const (
	// TargetContextKey used by the forwarder to get the target backend.
	TargetContextKey ContextKey = "krb.target"

	// BackendContextKey used to store the backend name.
	BackendContextKey ContextKey = "krb.backend"

	// DebugContextKey used to store the debug call.
	DebugContextKey ContextKey = ContextKey(debug.DebugContextKey)
)

type CustomHandlerFunc added in v0.8.0

type CustomHandlerFunc func(FlowComponent, http.ResponseWriter, *http.Request)

type Dummy added in v0.8.0

type Dummy struct {
	CustomHandler CustomHandlerFunc
	// contains filtered or unexported fields
}

Dummy can be used to replace components with a block that just forwards whatever request it's called to handle. This is useful to be able to easily disable certain components while keeping the structure the same.

func (*Dummy) GetMeta added in v0.8.0

func (d *Dummy) GetMeta() []adminapi.FlowMeta

GetMeta implements FlowComponent, dummy components will forward the GetMeta call to the next component in the flow without adding any additional metadata.

func (*Dummy) Next added in v0.8.0

func (d *Dummy) Next(next FlowComponent)

func (*Dummy) ServeHTTP added in v0.8.0

func (d *Dummy) ServeHTTP(w http.ResponseWriter, req *http.Request)

type FlowComponent added in v0.8.0

type FlowComponent interface {
	http.Handler

	Next(FlowComponent)
	GetMeta() []adminapi.FlowMeta
}

type FlowMeta added in v0.8.0

type FlowMeta struct {
	// Name is the name of the FlowComponent.
	Name string `json:"name"`
	// Data holds dynamic key-value pairs associated with this component.
	Data map[string]any `json:"data"`
}

FlowMeta holds metadata about a FlowComponent.

type Noop added in v1.7.5

type Noop struct{}

Noop can be used to replace components with a block that just silently stops processing on a ServeHTTP call. Useful for benchmarking.

func (*Noop) GetMeta added in v1.7.5

func (d *Noop) GetMeta() []adminapi.FlowMeta

GetMeta implements FlowComponent.

func (*Noop) Next added in v1.7.5

func (d *Noop) Next(_ FlowComponent)

func (*Noop) ServeHTTP added in v1.7.5

func (d *Noop) ServeHTTP(_ http.ResponseWriter, _ *http.Request)

type Opts

type Opts struct {
	Observability FlowComponent
	Router        FlowComponent
	Custom        FlowComponent
	Forwarder     FlowComponent
}

Directories

Path Synopsis
nolint: mnd
nolint: mnd

Jump to

Keyboard shortcuts

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