pipeline API

pipeline

package

API reference for the pipeline package.

Imports

(1)
T
type

Middleware

Middleware wraps a pipeline handler with cross-cutting behavior.

pkg/pipeline/pipeline.go:8-8
type Middleware func(ctx context.Context, input T, next func(context.Context, T) (U, error)) (U, error)
S
struct

Pipeline

Pipeline chains Middleware functions around a final handler.

pkg/pipeline/pipeline.go:11-14
type Pipeline struct

Fields

Name Type Description
middlewares []Middleware[T, U]
handler func(context.Context, T) (U, error)
F
function

New

New creates an empty Pipeline.

Returns

*Pipeline[T,
U]
pkg/pipeline/pipeline.go:17-19
func New[T, U any]() *Pipeline[T, U]

{
	return &Pipeline[T, U]{}
}