middleware

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRunMiddleware

func WithRunMiddleware(ctx context.Context, middleware RunMiddleware) context.Context

WithRunMiddleware returns a context that will cause run.Run to use the provided middleware to wrap the default RunFunc.

Only the most recently set middleware will be used. If multiple callers set middleware, only the last one wins.

This should only be called from CLI entrypoints. See package docs for details.

Types

type RunMiddleware

type RunMiddleware func(next api.RunFunc) api.RunFunc

RunMiddleware wraps an api.RunFunc to intercept and modify its behavior.

The middleware can:

  • Modify context, args, or options before calling next
  • Add StartupHooks via hook.WithStartupHook
  • Handle errors from next
  • Perform pre/post processing

See package documentation for usage constraints.

Jump to

Keyboard shortcuts

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