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 ¶
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.
Click to show internal directories.
Click to hide internal directories.