Help us shape the future of Go! Take the 2026 Go Developer Survey

ephemeral

package
v0.98.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFlowFailed = errors.New("flow execution failed")

ErrFlowFailed is returned when the flow itself fails (exit 1 in the binary).

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand builds and returns the cobra "ephemeral" subcommand. Logs are directed to stderr; the result JSON is the only stdout output.

Types

type Package

type Package struct {
	ExecutionID     string                         `json:"execution_id"`
	FlowID          string                         `json:"flow_id"`
	FlowDefinition  json.RawMessage                `json:"flow_definition"`
	Inputs          map[string]any                 `json:"inputs"`
	SecretInputKeys []string                       `json:"secret_input_keys,omitempty"`
	ReferencedFlows flowpkg.ReferencedFlowRegistry `json:"referenced_flows,omitempty"`
	// MaxHTTPCallsPerExecution is the HTTP call limit; zero records without one.
	MaxHTTPCallsPerExecution int `json:"max_http_calls_per_execution,omitempty"`
}

Package is the ephemeral execution bundle the server returns on launch and the CLI feeds to the runner via stdin or a file. It matches the server's ephemeral_runner.package shape exactly. IMPORTANT: inputs may contain secrets – never log values, only key names.

type Result

type Result struct {
	Status       string          `json:"status"`
	StartedAt    time.Time       `json:"started_at"`
	CompletedAt  time.Time       `json:"completed_at"`
	DurationMs   int64           `json:"duration_ms"`
	Result       *map[string]any `json:"result"`
	ErrorMessage *string         `json:"error_message,omitempty"`
	ErrorCode    *string         `json:"error_code,omitempty"`
}

Result is the ephemeral execution result the runner writes to stdout or a file, and the CLI POSTs as the ephemeral-result publication body. It matches the server's ephemeral result endpoint request shape exactly.

func Run

func Run(pkg *Package, opts ...runner.Option) Result

Run executes the flow described by pkg and returns the structured result. Inputs are treated as secrets: only key names are logged, never values. No control-plane clients (claim/heartbeat/complete) are constructed or called.

Jump to

Keyboard shortcuts

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