shell

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 20 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 Params added in v1.20.0

func Params() []string

Params returns the keys the shell action takes in with.

func Serve

func Serve()

func StopStarted added in v1.18.0

func StopStarted()

StopStarted stops the background commands this process started, with their process groups, and removes their logs. It waits for a command that is being started, and a command started afterwards is not seen; it is meant for a process that is about to end because of a signal.

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)

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 WithAfter added in v1.18.0

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

func WithBefore added in v1.18.0

func WithBefore(f func(cmd string, shell string, workdir string)) Option

type Req added in v1.18.0

type Req struct {
	Cmd        string            `map:"cmd" validate:"required"`
	Shell      string            `map:"shell"`
	Workdir    string            `map:"workdir"`
	Timeout    string            `map:"timeout"`
	Env        map[string]string `map:"env"`
	Background bool              `map:"background"`
	// Ready says when a background command is ready for the steps after
	// it: its key log names text the command writes once it is.
	Ready map[string]string `map:"ready"`
	// 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 added in v1.18.0

type Res struct {
	Code   int    `map:"code"`
	Stdout string `map:"stdout"`
	Stderr string `map:"stderr"`
	PID    int    `map:"pid"`
	Log    string `map:"log"`
	// TimedOut is true when the command was stopped at the timeout. Code
	// is then -1, and Stdout and Stderr hold what it wrote until then.
	TimedOut bool `map:"timed_out"`
}

type Result added in v1.18.0

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