execution

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessState stateType = "success"
	ErrorState   stateType = "error"
	RunningState stateType = "running"
)

States of execution

Variables

This section is empty.

Functions

This section is empty.

Types

type DirExecStatusMap

type DirExecStatusMap map[string]map[string]FileExecStatus

DirExecStatusMap is a map of: directory -> file exec status of each file within that directory

type FileExecStatus

type FileExecStatus struct {
	StartTime       time.Time `json:"startTime"`
	TimeTaken       string    `json:"timeTaken"`
	LastSuccessTime string    `json:"lastSuccessTime"`
	LastErrorTime   string    `json:"lastErrorTime"`
	State           stateType `json:"state"`
	LogFilePath     string    `json:"logFilePath"`
}

FileExecStatus captures the status of a file

type Instance

type Instance struct {
	DryRunEnabled   bool
	ReRun           bool
	LogDir          string
	ExecutionSource map[string]string
	GeneratedDir    string
	TemplateDir     string
	Error           error
	DoRunParallel   bool
	Interrupter     chan os.Signal
	WaitGroup       *sync.WaitGroup
	Mutex           sync.RWMutex
	TimeoutInterval time.Duration
	State
}

Instance is the main struct for execution configs

func (*Instance) DeleteState

func (i *Instance) DeleteState(directory string) *Instance

DeleteState deletes state

func (*Instance) Init

func (i *Instance) Init()

Init the execution instance

func (*Instance) PrintSeparator

func (i *Instance) PrintSeparator()

PrintSeparator prints a separator

func (*Instance) PrintState

func (i *Instance) PrintState(directory string) *Instance

PrintState prints current state

func (*Instance) ReturnState

func (i *Instance) ReturnState(directory string) *Instance

ReturnState returns state

func (*Instance) RunScriptsInDir

func (i *Instance) RunScriptsInDir(fullDirPath string)

RunScriptsInDir handles running of script files inside a directory

func (*Instance) StopRunningCmd

func (i *Instance) StopRunningCmd()

StopRunningCmd stops currently running command

type State

type State struct {
	StateFilePath        string
	StateFileDefaultname string
	DeploymentID         string
	StateFileName        string
	ReturnStateMap       DirExecStatusMap
	DirExecStatusMap     DirExecStatusMap
}

State is the main struct to hold state object

Jump to

Keyboard shortcuts

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