embedded

package
v1.25.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute added in v1.18.0

func Execute(data map[string]any, opts ...Option) (map[string]any, error)

func Keeps added in v1.21.0

func Keeps() []string

Keeps returns the kinds of guard the embedded action keeps to: it runs its job under the guard of the run, whose steps keep to it or are refused.

func Params added in v1.20.0

func Params() []string

Params returns the keys the embedded action takes in with.

func Serve

func Serve()

func ServeWithActions added in v1.25.0

func ServeWithActions(builtin []string)

ServeWithActions is Serve for an action that knows builtin, the names of the actions of Probe: a job that uses any other name is stopped before its first step, and told which name.

Types

type Action

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

func (*Action) Run

func (a *Action) Run(with map[string]any) (map[string]any, error)

func (*Action) RunStep added in v1.19.0

func (a *Action) RunStep(call actionrpc.Call) (map[string]any, map[string]any, error)

RunStep runs the job as part of the run of the step that embeds it. It keeps no state of its own: the job keeps its own state, in its own run.

type Callback added in v1.18.0

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

type Option added in v1.18.0

type Option func(*Callback)

func WithActions added in v1.25.0

func WithActions(names map[string]string) Option

WithActions reads the job by names, the names the workflow of the step that embeds it gives its external actions.

func WithAfter added in v1.18.0

func WithAfter(f func(result *Result)) Option

func WithBefore added in v1.18.0

func WithBefore(f func(path string, vars map[string]any)) Option

func WithBuiltinActions added in v1.25.0

func WithBuiltinActions(names []string) Option

WithBuiltinActions tells the job the names of the actions of Probe, so that a uses that names no action stops the job before any step runs.

func WithGuard added in v1.20.0

func WithGuard(guard actionrpc.Guard) Option

WithGuard runs the job under the guard of the run of the step that embeds it.

func WithRunID added in v1.19.0

func WithRunID(id string) Option

WithRunID runs the job as part of the run id names, the run of the step that embeds it, so that the actions of the job are told the same run.

type Req

type Req struct {
	Path string         `map:"path" validate:"required"`
	Vars map[string]any `map:"vars"`
	// contains filtered or unexported fields
}

func NewReq added in v1.18.0

func NewReq() *Req

func (*Req) Do added in v1.18.0

func (r *Req) Do() (*Result, error)

type Res

type Res struct {
	Code    int            `map:"code"`
	Outputs map[string]any `map:"outputs"`
	Report  string         `map:"report"`
	Error   string         `map:"error"`
	Dump    bool           `map:"dump"`
}

type Result

type Result struct {
	Req    Req           `map:"req"`
	Res    Res           `map:"res"`
	RT     time.Duration `map:"rt"`
	Status int           `map:"status"`
}

Jump to

Keyboard shortcuts

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