contracts

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PoolsFromContext added in v0.8.0

func PoolsFromContext(ctx context.Context) map[string][]string

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 RegistryFromContext(ctx context.Context) *action.Registry

func WithCompiler added in v0.6.0

func WithCompiler(ctx context.Context, c PipelineCompiler) context.Context

func WithPools added in v0.8.0

func WithPools(ctx context.Context, pools map[string][]string) context.Context

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.

func WithRegistry added in v0.6.0

func WithRegistry(ctx context.Context, reg *action.Registry) context.Context

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.

Jump to

Keyboard shortcuts

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