action

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name    string `yaml:"name" required:"true"`
	Command string `yaml:"command" required:"true"`
	Code    int    `yaml:"code" default:"0"`
	Cron    string `yaml:"cron" default:"* * * * *"`
	Tries   int    `yaml:"tries" default:"1"`
	On      On     `yaml:"when"`
}

func (*Action) Execute

func (a *Action) Execute() domain.Result

func (Action) GetCommand added in v0.2.8

func (a Action) GetCommand() string

func (Action) GetCron added in v0.2.8

func (a Action) GetCron() string

func (Action) GetName added in v0.2.8

func (a Action) GetName() string

func (Action) GetTries added in v0.2.9

func (a Action) GetTries() int

func (*Action) Validate

func (a *Action) Validate() error

type ActionFailed added in v0.2.9

type ActionFailed struct {
	Expected int
	Actual   int
}

func (ActionFailed) Error added in v0.2.9

func (a ActionFailed) Error() string

type On

type On struct {
	Start   string `yaml:"start"`
	Success string `yaml:"success"`
	Failure string `yaml:"failure"`
}

func (*On) Validate

func (o *On) Validate() error

type Result added in v0.2.0

type Result struct {
	Action *Action
	Err    error
	Code   int
	Stdout string
	Tries  int
}

func (Result) GetAction added in v0.2.8

func (r Result) GetAction() domain.Action

func (Result) GetCode added in v0.2.8

func (r Result) GetCode() int

func (Result) GetErr added in v0.2.8

func (r Result) GetErr() error

func (Result) GetStdout added in v0.2.8

func (r Result) GetStdout() string

func (Result) GetTries added in v0.2.9

func (r Result) GetTries() int

Jump to

Keyboard shortcuts

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