steps

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package steps defines the StepExecutor interface and a registry of built-in step type implementations for the workflow engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainClient

type ChainClient interface {
	BroadcastTx(ctx context.Context, msgType string, params map[string]string) (*TxResult, error)
	Query(ctx context.Context, path string, params map[string]string) (json.RawMessage, error)
}

ChainClient is the interface workflows use to interact with the chain. Implemented by the chain client package (Phase 1.8).

type CheckExecutor

type CheckExecutor struct{}

CheckExecutor asserts a condition. If the condition is false, the step either skips or aborts based on on-fail.

func (*CheckExecutor) Execute

func (*CheckExecutor) Type

func (e *CheckExecutor) Type() workflow.StepType

type OutputExecutor

type OutputExecutor struct {
	// Out is the destination for rendered templates. Nil means os.Stdout.
	Out io.Writer
}

OutputExecutor renders a Go template and writes it to Out (stdout by default). The rendered text is also recorded in the step result's Output under "text" so callers running in structured output modes (e.g. JSONL) can redirect Out and still access the rendered content.

func (*OutputExecutor) Execute

func (*OutputExecutor) Type

func (e *OutputExecutor) Type() workflow.StepType

type PromptExecutor

type PromptExecutor struct{}

PromptExecutor handles interactive user input steps (e.g. bid selection).

func (*PromptExecutor) Execute

func (*PromptExecutor) Type

func (e *PromptExecutor) Type() workflow.StepType

type ProviderClient

type ProviderClient interface {
	SendManifest(ctx context.Context, provider string, dseq uint64, sdl []byte) error
	SendManifestToActiveLeases(ctx context.Context, dseq uint64, sdl []byte) ([]string, error)
	LeaseStatus(ctx context.Context, provider string, dseq uint64) (json.RawMessage, error)
}

ProviderClient is the interface for provider gateway operations. Implemented by the provider client package (Phase 2).

type ProviderExecutor

type ProviderExecutor struct {
	// contains filtered or unexported fields
}

ProviderExecutor handles provider gateway calls (send-manifest, lease-status, etc).

func (*ProviderExecutor) Execute

func (*ProviderExecutor) Type

type QueryExecutor

type QueryExecutor struct {
	// contains filtered or unexported fields
}

QueryExecutor executes a chain query.

func (*QueryExecutor) Execute

func (*QueryExecutor) Type

func (e *QueryExecutor) Type() workflow.StepType

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maps step types to their executors.

func NewRegistry

func NewRegistry(chain ChainClient, provider ProviderClient) *Registry

NewRegistry creates a registry pre-loaded with all built-in step executors.

func (*Registry) Get

Get returns the executor for the given step type.

func (*Registry) Register

func (r *Registry) Register(e workflow.StepExecutor)

Register adds or replaces an executor for a step type.

type ShellExecutor

type ShellExecutor struct{}

ShellExecutor runs a shell command. For custom workflows.

func (*ShellExecutor) Execute

func (*ShellExecutor) Type

func (e *ShellExecutor) Type() workflow.StepType

type TxExecutor

type TxExecutor struct {
	// contains filtered or unexported fields
}

TxExecutor broadcasts a transaction to the chain.

func (*TxExecutor) Execute

func (e *TxExecutor) Execute(ctx context.Context, step workflow.StepDef, state *workflow.RunState) (*workflow.StepResult, error)

func (*TxExecutor) Type

func (e *TxExecutor) Type() workflow.StepType

type TxResult

type TxResult struct {
	TxHash string          `json:"tx_hash"`
	Height int64           `json:"height"`
	Code   uint32          `json:"code"`
	Data   json.RawMessage `json:"data,omitempty"`
}

TxResult holds the result of a broadcast transaction.

type WaitExecutor

type WaitExecutor struct {
	// contains filtered or unexported fields
}

WaitExecutor polls a query until a condition is met or timeout expires.

func NewWaitExecutor added in v0.0.5

func NewWaitExecutor(chain ChainClient, progress WaitProgressReporter) *WaitExecutor

NewWaitExecutor returns a wait executor with optional progress reporting.

func (*WaitExecutor) Execute

func (*WaitExecutor) Type

func (e *WaitExecutor) Type() workflow.StepType

type WaitProgress added in v0.0.5

type WaitProgress struct {
	Step      string
	Query     string
	Elapsed   time.Duration
	Remaining time.Duration
	Result    json.RawMessage
}

WaitProgress describes one successful poll of a wait step.

type WaitProgressReporter added in v0.0.5

type WaitProgressReporter func(WaitProgress)

WaitProgressReporter receives successful wait polls. It is optional; the workflow engine itself never writes progress to a terminal.

Jump to

Keyboard shortcuts

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