object

package
v0.0.0-...-4fc6743 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockNotFound       = errors.New("function block was not found or is malformed")
	ErrInvalidKeyValuePair = errors.New("invalid key=value pair")
)

Functions

func SetArrayFunctionParams

func SetArrayFunctionParams(original, oldArray, newArray []string) []string

func SetBlockDirectory

func SetBlockDirectory(block StatefulFunctionBlock) (string, error)

func SetBlockOperatingSystem

func SetBlockOperatingSystem(block StatefulFunctionBlock) string

func SetEnvironmentVariables

func SetEnvironmentVariables(original string) string

func SetFunctionParams

func SetFunctionParams(original string, oldArray []string, newArray []string) string

func SetKeyValueVariables

func SetKeyValueVariables(original string, pairs []string) (string, error)

Types

type Command

type Command struct {
	OS          string     `json:"os"`
	Directory   string     `json:"directory"`
	Command     string     `json:"command"`
	Expression  Expression `json:"expression"`
	Environment []string   `json:"environment"`
}

type Expression

type Expression struct {
	OperandA  string `json:"operandA"`
	OperandB  string `json:"operandB"`
	Operation int    `json:"operation"`
	Result    bool   `json:"result"`
}

func SetOperandFunctionParams

func SetOperandFunctionParams(expr Expression, oldArray []string, newArray []string) Expression

type FunctionBlock

type FunctionBlock struct {
	Name     string    `json:"name"`
	Params   []string  `json:"params"`
	Commands []Command `json:"commands"`
}

type StatefulFunctionBlock

type StatefulFunctionBlock struct {
	Name        string     `json:"name"`
	Params      []string   `json:"params"`
	Commands    []Command  `json:"commands"`
	OS          string     `json:"os"`
	Directory   string     `json:"directory"`
	Expression  Expression `json:"expression"`
	Environment []string   `json:"environment"`
}

func GetBlock

func GetBlock(blocks []StatefulFunctionBlock, blockName string) (StatefulFunctionBlock, error)

func (*StatefulFunctionBlock) SetCallerBlock

func (currentBlock *StatefulFunctionBlock) SetCallerBlock(blocks []StatefulFunctionBlock, callerName string, callerParams []string) error

Jump to

Keyboard shortcuts

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