embedded

package
v1.26.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

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

func Keeps

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

func Params() []string

Params returns the keys the embedded action takes in with.

func Serve

func Serve()

func ServeWithActions

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

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

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

type Option

type Option func(*Callback)

func WithActions

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

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

func WithBefore

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

func WithBuiltinActions

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

func WithGuard(guard actionrpc.Guard) Option

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

func WithRunID

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

func NewReq() *Req

func (*Req) Do

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