embedded

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 10 Imported by: 1 module, 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

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 ServeWithActions

func ServeWithActions(builtin []string, opts ...Option)

ServeWithActions serves the embedded action, which 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. opts are given to every job it runs, such as WithNeedsNoCheck.

func Spec added in v1.30.0

func Spec() actionspec.Spec

Spec declares the embedded action. It keeps to every kind of guard: it runs its job under the guard of the run, whose steps keep to it or are refused. It cannot run without path.

Spec leaves Serve to the registry, which serves the action with ServeWithActions to tell it the names of the actions of Probe.

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 WithCleanups added in v1.27.0

func WithCleanups(c *actionrpc.Cleanups) Option

WithCleanups leaves what the steps of the job left behind for the rest of the run of the step that embeds it, which cleans up once it is over: the actions to call then are named in c.

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 WithNeedsNoCheck added in v1.30.0

func WithNeedsNoCheck(names []string) Option

WithNeedsNoCheck tells the job the names of the actions whose steps pass without a test, so that a step of one that has none is not counted as untested.

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