models

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Description = make(map[string]interface{})

Functions

func GetDescription

func GetDescription() interface{}

func SetDescription

func SetDescription(config *YamlConfig, description interface{})

Types

type CommandDescription

type CommandDescription struct {
	Finished   bool                      `json:"finished"`
	Started    bool                      `json:"started"`
	Startedat  string                    `json:"startedat"`
	Finishedat string                    `json:"finishedat"`
	Duration   float64                   `json:"duration"`
	Pid        int                       `json:"pid"`
	Id         string                    `json:"id"`
	Commands   map[string]*CommandStatus `json:"commands"`
	Processes  []*ProcessInfo            `json:"processes"`
}

func NewCommandDescription

func NewCommandDescription() *CommandDescription

func (*CommandDescription) GetCommands

func (cd *CommandDescription) GetCommands() map[string]*CommandStatus

func (*CommandDescription) GetDuration

func (cd *CommandDescription) GetDuration() float64

func (*CommandDescription) GetFinishedAt

func (cd *CommandDescription) GetFinishedAt() string

func (*CommandDescription) GetId

func (cd *CommandDescription) GetId() string

func (*CommandDescription) GetPid

func (cd *CommandDescription) GetPid() int

func (*CommandDescription) GetProcesses

func (cd *CommandDescription) GetProcesses() []*ProcessInfo

func (*CommandDescription) GetStartedAt

func (cd *CommandDescription) GetStartedAt() string

func (*CommandDescription) IsFinished

func (cd *CommandDescription) IsFinished() bool

func (*CommandDescription) IsStarted

func (cd *CommandDescription) IsStarted() bool

func (*CommandDescription) SetCommands

func (cd *CommandDescription) SetCommands(commands map[string]*CommandStatus)

func (*CommandDescription) SetDuration

func (cd *CommandDescription) SetDuration(duration float64)

func (*CommandDescription) SetFinished

func (cd *CommandDescription) SetFinished(isFinished bool)

func (*CommandDescription) SetFinishedAt

func (cd *CommandDescription) SetFinishedAt(finishedAt string)

func (*CommandDescription) SetId

func (cd *CommandDescription) SetId(id string)

func (*CommandDescription) SetPid

func (cd *CommandDescription) SetPid(pid int)

func (*CommandDescription) SetProcesses

func (cd *CommandDescription) SetProcesses(processes []*ProcessInfo)

func (*CommandDescription) SetStarted

func (cd *CommandDescription) SetStarted(isStarted bool)

func (*CommandDescription) SetStartedAt

func (cd *CommandDescription) SetStartedAt(startedAt string)

type CommandDetails

type CommandDetails struct {
	Out  string   `json:"out"`
	Err  string   `json:"err"`
	Pid  int      `json:"pid"`
	Code int      `json:"code"`
	Args []string `json:"args"`
}

func NewCommandDetails

func NewCommandDetails() *CommandDetails

func (*CommandDetails) GetArgs

func (cd *CommandDetails) GetArgs() []string

func (*CommandDetails) GetCode

func (cd *CommandDetails) GetCode() int

func (*CommandDetails) GetErr

func (cd *CommandDetails) GetErr() string

func (*CommandDetails) GetOut

func (cd *CommandDetails) GetOut() string

func (*CommandDetails) GetPid

func (cd *CommandDetails) GetPid() int

func (*CommandDetails) SetArgs

func (cd *CommandDetails) SetArgs(args []string)

func (*CommandDetails) SetCode

func (cd *CommandDetails) SetCode(code int)

func (*CommandDetails) SetErr

func (cd *CommandDetails) SetErr(err string)

func (*CommandDetails) SetOut

func (cd *CommandDetails) SetOut(out string)

func (*CommandDetails) SetPid

func (cd *CommandDetails) SetPid(pid int)

type CommandStatus

type CommandStatus struct {
	Status         string          `json:"status"`
	CommandDetails *CommandDetails `json:"details"`
	Startedat      string          `json:"startedat"`
	Finishedat     string          `json:"finishedat"`
	Duration       float64         `json:"duration"`
}

func NewCommandStatus

func NewCommandStatus() *CommandStatus

func (*CommandStatus) GetCommandDetails

func (cs *CommandStatus) GetCommandDetails() *CommandDetails

func (*CommandStatus) GetDuration

func (cs *CommandStatus) GetDuration() float64

func (*CommandStatus) GetFinishedAt

func (cs *CommandStatus) GetFinishedAt() string

func (*CommandStatus) GetStartedAt

func (cs *CommandStatus) GetStartedAt() string

func (*CommandStatus) GetStatus

func (cs *CommandStatus) GetStatus() string

func (*CommandStatus) SetCommandDetails

func (cs *CommandStatus) SetCommandDetails(cd *CommandDetails)

func (*CommandStatus) SetDuration

func (cs *CommandStatus) SetDuration(duration float64)

func (*CommandStatus) SetFinishedAt

func (cs *CommandStatus) SetFinishedAt(finishedAt string)

func (*CommandStatus) SetStartedAt

func (cs *CommandStatus) SetStartedAt(startedAt string)

func (*CommandStatus) SetStatus

func (cs *CommandStatus) SetStatus(status string)

type ProcessInfo

type ProcessInfo struct {
	Pid  int    `json:"pid"`
	PPid int    `json:"parent"`
	Name string `json:"name"`
}

func NewProcessInfo

func NewProcessInfo() *ProcessInfo

func (*ProcessInfo) GetName

func (pi *ProcessInfo) GetName() string

func (*ProcessInfo) GetPPid

func (pi *ProcessInfo) GetPPid() int

func (*ProcessInfo) GetPid

func (pi *ProcessInfo) GetPid() int

func (*ProcessInfo) SetName

func (pi *ProcessInfo) SetName(name string)

func (*ProcessInfo) SetPPid

func (pi *ProcessInfo) SetPPid(ppid int)

func (*ProcessInfo) SetPid

func (pi *ProcessInfo) SetPid(pid int)

type YamlConfig

type YamlConfig struct {
	Env           map[string]string `yaml:"env" json:"env,omitempty"`
	BeforeInstall []string          `yaml:"before_install" json:"before_install,omitempty"`
	Install       []string          `yaml:"install" json:"install,omitempty"`
	AfterInstall  []string          `yaml:"after_install" json:"after_install,omitempty"`
	BeforeScript  []string          `yaml:"before_script" json:"before_script,omitempty"`
	Script        []string          `yaml:"script" json:"script,omitempty"`
	AfterScript   []string          `yaml:"after_script" json:"after_script,omitempty"`
}

func NewYamlConfig

func NewYamlConfig() *YamlConfig

func (*YamlConfig) GetAfterInstall

func (config *YamlConfig) GetAfterInstall() []string

func (*YamlConfig) GetAfterScript

func (config *YamlConfig) GetAfterScript() []string

func (*YamlConfig) GetBeforeInstall

func (config *YamlConfig) GetBeforeInstall() []string

func (*YamlConfig) GetBeforeScript

func (config *YamlConfig) GetBeforeScript() []string

func (*YamlConfig) GetEnv

func (config *YamlConfig) GetEnv() map[string]string

func (*YamlConfig) GetInstall

func (config *YamlConfig) GetInstall() []string

func (*YamlConfig) GetScript

func (config *YamlConfig) GetScript() []string

func (*YamlConfig) SetAfterInstall

func (config *YamlConfig) SetAfterInstall(afterInstall []string)

func (*YamlConfig) SetAfterScript

func (config *YamlConfig) SetAfterScript(afterScript []string)

func (*YamlConfig) SetBeforeInstall

func (config *YamlConfig) SetBeforeInstall(beforeInstall []string)

func (*YamlConfig) SetBeforeScript

func (config *YamlConfig) SetBeforeScript(beforeScript []string)

func (*YamlConfig) SetEnv

func (config *YamlConfig) SetEnv(env map[string]string)

func (*YamlConfig) SetInstall

func (config *YamlConfig) SetInstall(install []string)

func (*YamlConfig) SetScript

func (config *YamlConfig) SetScript(script []string)

Jump to

Keyboard shortcuts

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