shellaction

package
v0.0.0-...-31db053 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShellAction

type ShellAction struct {
	Type   string         `mapstructure:"type"`
	Config actions.Config `mapstructure:"config"`
	Params struct {
		Command      string            `mapstructure:"command" default:"/bin/sh" validate:"required"`
		Args         []string          `mapstructure:"args" default:"[]"`
		Timeout      int               `mapstructure:"timeout" default:"20"`
		Env          map[string]string `mapstructure:"env" default:"{}"`
		NoInheritEnv bool              `mapstructure:"no_inherit_env" default:"false"`
		Dir          string            `mapstructure:"dir" default:""`
		Echo         bool              `mapstructure:"echo" default:"false"`
	} `mapstructure:"params"`
	// contains filtered or unexported fields
}

func NewAction

func NewAction(ctx context.Context, konfig *koanf.Koanf) (*ShellAction, error)

NewAction creates a new ShellAction. It takes a koanf object to hydrate the action struct. It consumes the whole koanf object, so you likely want to carve it off a larger koanf object.

func (*ShellAction) Execute

func (a *ShellAction) Execute(ctx context.Context) error

func (*ShellAction) GetConfig

func (a *ShellAction) GetConfig() actions.Config

Jump to

Keyboard shortcuts

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