function

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builtin

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

Builtin runs a registered builtin function by name.

func NewBuiltin

func NewBuiltin(loadedFrom runner.StepReference, params *runner.StepParams, funcDesc *runner.FunctionDescriptor, stepFuncFinder runner.StepFuncFinder) *Builtin

func (*Builtin) Describe

func (s *Builtin) Describe() string

func (*Builtin) Run

func (s *Builtin) Run(ctx context.Context, stepsCtx *runner.StepsContext) (*proto.StepResult, error)

type Exec

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

Exec is a function that executes a command.

func NewExec

func NewExec(loadedFrom runner.StepReference, params *runner.StepParams, funcDesc *runner.FunctionDescriptor) *Exec

func (*Exec) Describe

func (s *Exec) Describe() string

func (*Exec) Run

func (s *Exec) Run(ctx context.Context, stepsCtx *runner.StepsContext) (*proto.StepResult, error)

type Parser

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

func NewParser

func NewParser(resParser *resource.Parser, stepFuncFinder runner.StepFuncFinder) *Parser

func (*Parser) Parse

func (p *Parser) Parse(globalCtx *runner.GlobalContext, funcDesc *runner.FunctionDescriptor, params *runner.StepParams, loadedFrom runner.StepReference) (runner.Function, error)

type Safe added in v0.34.0

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

Safe wraps a Function with panic recovery. If the inner function panics, the panic is recovered and returned as a failure result with an internal error.

func WithPanicRecovery added in v0.34.0

func WithPanicRecovery(fn runner.Function) *Safe

WithPanicRecovery wraps fn so that panics during Run are recovered and returned as an internal error.

func (*Safe) Describe added in v0.34.0

func (s *Safe) Describe() string

func (*Safe) Run added in v0.34.0

func (s *Safe) Run(ctx context.Context, stepsCtx *runner.StepsContext) (result *proto.StepResult, retErr error)

Run delegates to the inner function, recovering any panic as an internal error.

type Step

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

Step resolves a function reference at runtime and delegates execution to the loaded function.

func NewStep

func NewStep(globalCtx *runner.GlobalContext, parser runner.StepParser, stepReference *proto.Step, stepResource runner.StepResource) *Step

func (*Step) Describe

func (s *Step) Describe() string

func (*Step) Run

func (s *Step) Run(ctx ctx.Context, parentStepsCtx *runner.StepsContext) (*proto.StepResult, error)

Run fetches a step definition, parses the step, and executes it. The step reference inputs and environment are expanded. The current environment is cloned into params in preparation for a recursive call to Run.

type Steps

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

Steps runs a sequence of steps in order, accumulating their results.

func NewSteps

func NewSteps(loadedFrom runner.StepReference, params *runner.StepParams, funcDesc *runner.FunctionDescriptor, steps ...runner.Function) *Steps

func (*Steps) Describe

func (s *Steps) Describe() string

func (*Steps) Run

func (s *Steps) Run(ctx ctx.Context, stepsCtx *runner.StepsContext) (*proto.StepResult, error)

Jump to

Keyboard shortcuts

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