actors

package
v0.5.1-beta-hotfix1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActionFuncMap map[string]*ActionLayout = map[string]*ActionLayout{
	"run_script":       {F: RunScript, N: NextOKKO, R: true},
	"define_envs":      {F: DefineEnvs, N: NextOKKO, R: false},
	"define_variables": {F: DefineVars, N: NextOKKO, R: false},
	"upload_files":     {F: RemoteCopy, N: NextOKKO, R: true},
	"download_files":   {F: RemoteCopy, N: NextOKKO, R: true},
	"condition":        {F: ConditionParse, N: NextOKKO, R: false},
	"start":            {F: DefineVars, N: NextOKKO, R: false},
	"group":            {F: NOOP, N: NextOKKO, R: false},
	"stop":             {F: Stop, N: NextOKKO, R: false},
	"end":              {F: NOOP, N: NextOKKO, R: false},
	"sleep":            {F: Sleep, N: NextOKKO, R: false},
	"ok/ko":            {F: OKKO, N: NextOKKO, R: false},
	"log":              {F: Log, N: NextOKKO, R: false},
	"noop":             {F: NOOP, N: NextOK, R: false},
	"panic":            {F: Panic, N: NextOKKO, R: false},
	"send_mail":        {F: SendMail, N: NextOKKO, R: true},
	"send_email":       {F: SendMail, N: NextOKKO, R: true},
	"http_request":     {F: HttpRequest, N: NextOKKO, R: true},
	"read_file":        {F: ReadFile, N: NextOKKO, R: false},
	"write_file":       {F: WriteFile, N: NextOKKO, R: false},

	"join_threads": {F: NOOP, N: NextOK, R: false},
	"debug":        {F: NOOP, N: NextOK, R: false},
}

ActionFuncMap map

Functions

func ConditionParse

func ConditionParse(ctx *ActionContext) (*base.ActionOutput, error)

ConditionParse func

func DefineEnvs

func DefineEnvs(ctx *ActionContext) (*base.ActionOutput, error)

func DefineVars

func DefineVars(ctx *ActionContext) (*base.ActionOutput, error)

DefineVars func

func HttpRequest

func HttpRequest(ctx *ActionContext) (*base.ActionOutput, error)

RunRemoteScript func

func Log

func Log(ctx *ActionContext) (*base.ActionOutput, error)

Log func

func NOOP

func NOOP(ctx *ActionContext) (*base.ActionOutput, error)

func OKKO

func OKKO(ctx *ActionContext) (*base.ActionOutput, error)

OKKO func

func Panic

func Panic(ctx *ActionContext) (*base.ActionOutput, error)

Panic func

func ReadFile

func ReadFile(ctx *ActionContext) (*base.ActionOutput, error)

func RemoteCopy

func RemoteCopy(ctx *ActionContext) (*base.ActionOutput, error)

func RunLocalScript

func RunLocalScript(ctx *ActionContext) (*base.ActionOutput, error)

RunLocalScript func

func RunRemoteScript

func RunRemoteScript(ctx *ActionContext) (*base.ActionOutput, error)

RunRemoteScript func

func RunScript

func RunScript(ctx *ActionContext) (*base.ActionOutput, error)

func ScpCopy

func ScpCopy(ctx *ActionContext) (*base.ActionOutput, error)

func SendMail

func SendMail(ctx *ActionContext) (*base.ActionOutput, error)

func Sleep

func Sleep(ctx *ActionContext) (*base.ActionOutput, error)

Sleep func

func Stop

func Stop(ctx *ActionContext) (*base.ActionOutput, error)

func WriteFile

func WriteFile(ctx *ActionContext) (*base.ActionOutput, error)

Types

type ActionContext

type ActionContext struct {
	Rehearsal bool
	Action    *base.Action
	Store     base.IStore
	Logger    base.ILogger
	Actx      base.IActionContext
}

ActionContext struct

func (*ActionContext) DebugInit

func (a *ActionContext) DebugInit()

func (*ActionContext) GetMustarFD

func (a *ActionContext) GetMustarFD() io.ReadWriteCloser

func (*ActionContext) GetSluvaFD

func (a *ActionContext) GetSluvaFD() io.ReadWriteCloser

type ActionFunc

type ActionFunc func(ctx *ActionContext) (*base.ActionOutput, error)

ActionFunc func

type ActionLayout

type ActionLayout struct {
	F ActionFunc
	N NextType
	// Retriable or not
	R bool
}

ActionLayout struct

type BodyType

type BodyType string
const (
	BodyTypeNone               BodyType = "none"
	BodyTypeFormData           BodyType = "form-data"
	BodyTypeXWWWFormUrlencoded BodyType = "x-www-form-urlencoded"
	BodyTypeRaw                BodyType = "raw"
	BodyTypeBinary             BodyType = "binary"
)

type Condition

type Condition struct {
	ID         string       `json:"id"`
	Field      string       `json:"field"`
	Operator   string       `json:"operator"`
	Value      string       `json:"value"`
	Rules      []*Condition `json:"rules"`
	Combinator string       `json:"combinator"`
	//
	Not bool `json:"not"`
	// contains filtered or unexported fields
}

Condition struct

type LogFunc

type LogFunc func(b []byte)

type NextType

type NextType int

NextType int

const (
	// NextOKKO const 0
	NextOKKO NextType = iota
	// NextOK const 1
	NextOK
	// NextKO const
	NextKO
)

type PartType

type PartType string
const (
	PartTypeText PartType = "text"
	PartTypeFile PartType = "file"
)

type SleepParameters

type SleepParameters struct {
	Seconds int64 `json:"seconds" validate:"required"`
}

type VarType

type VarType string
const (
	VarTypeString             VarType = "string"
	VarTypeBool               VarType = "boolean"
	VarTypeInt                VarType = "int"
	VarTypeSelectableStatic   VarType = "selectable-static-values"
	VarTypeSelectableVariable VarType = "selectable-variables"
)

Jump to

Keyboard shortcuts

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