Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FileLogLocation = "/dev/null"
TODO dont use a global var, add this to the ctx FileLogLocation to which we write all cmd stdout, stderr
Functions ¶
func GenericExecute ¶
GenericExecute runs a command and only reports back error message
Types ¶
type Command ¶
Command interface execute a cli command and returns the stdout, stderr and any error msgs
type CommandLine ¶
type CommandLine struct { EnvVars map[string]string CommandName string Args []string Ctx *context.Context }
The CommandLine contains the env var, command name and args to be run
func NewCommandLine ¶
func NewCommandLine(envs map[string]string, cmd string, args []string, ctx *context.Context) *CommandLine
NewCommandLine constructs a new CommandLine instance
func (*CommandLine) Program ¶
func (c *CommandLine) Program() Command
Program is the only method executed for the CommandLine
type CommandSession ¶
type CommandSession struct { CommandLine *CommandLine Ctx context.Context }
The CommandSession contains the CommandLine
func (*CommandSession) Execute ¶
func (c *CommandSession) Execute() ([]byte, []byte, error)
Execute runs the cli command
func (*CommandSession) Exists ¶
func (c *CommandSession) Exists() bool
Exists checks if a command is in the $PATH var
type ExternalCommand ¶
type ExternalCommand struct { Name string Actions *CommandLine // contains filtered or unexported fields }
ExternalCommand is a single external command
type ProvisionerCommands ¶
type ProvisionerCommands struct { Name string // contains filtered or unexported fields }
ProvisionerCommands head of command list
func CreateCommandList ¶
func CreateCommandList(name string) *ProvisionerCommands
CreateCommandList constructor
func (*ProvisionerCommands) AddCommand ¶
func (c *ProvisionerCommands) AddCommand(name string, actions *CommandLine) error
AddCommand adds a command to the list
func (*ProvisionerCommands) GetAll ¶
func (c *ProvisionerCommands) GetAll() []string
GetAll returns all commands in the linked list
func (*ProvisionerCommands) NotInPath ¶
func (c *ProvisionerCommands) NotInPath() []string
NotInPath returns commands in the linked list that dont exist in the $PATH
func (*ProvisionerCommands) Remove ¶
func (c *ProvisionerCommands) Remove(t string) error
Remove removes a node