Documentation
¶
Index ¶
- func PoolsFromContext(ctx context.Context) map[string][]string
- func RegistryFromContext(ctx context.Context) *action.Registry
- func WithCompiler(ctx context.Context, c PipelineCompiler) context.Context
- func WithPools(ctx context.Context, pools map[string][]string) context.Context
- func WithRecoveredError(ctx context.Context, r *RecoveredError) context.Context
- func WithRegistry(ctx context.Context, reg *action.Registry) context.Context
- type PipelineCompiler
- type RecoveredError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PoolsFromContext ¶ added in v0.8.0
PoolsFromContext reads the pool table WithPools stored. Missing key returns nil, which the dispatch node treats as "no pools declared".
func RegistryFromContext ¶ added in v0.6.0
func WithCompiler ¶ added in v0.6.0
func WithCompiler(ctx context.Context, c PipelineCompiler) context.Context
func WithPools ¶ added in v0.8.0
WithPools attaches the flow's @pool declarations to the execution context. The runner calls this before Execute so that a dispatch node can look up its pool by name without the compiler having to thread the pool table through every layer.
A nil or empty map is a no-op.
func WithRecoveredError ¶ added in v0.8.0
func WithRecoveredError(ctx context.Context, r *RecoveredError) context.Context
WithRecoveredError installs r into ctx. Called by a recovery node before it invokes the matched target.
Types ¶
type PipelineCompiler ¶
type PipelineCompiler interface {
CompilePipeline(expr string) (action.Executable, error)
}
func CompilerFromContext ¶ added in v0.6.0
func CompilerFromContext(ctx context.Context) PipelineCompiler
type RecoveredError ¶ added in v0.8.0
type RecoveredError struct {
Err error
Kind string // string form of xerr.Kind; empty for non-xerr errors
Suspended bool
}
RecoveredError carries the failing error through the recovery target's context. Recovery targets that care about the cause read it with RecoveredErrorFrom. Targets that only need the original input ignore it.
func RecoveredErrorFrom ¶ added in v0.8.0
func RecoveredErrorFrom(ctx context.Context) (*RecoveredError, bool)
RecoveredErrorFrom returns the error that triggered recovery, if any.