Documentation ¶
Index ¶
- type Command
- type DockerCommand
- type EchoCommand
- type ExecutionContext
- func (ec *ExecutionContext) AddToContext(key string, value string) error
- func (ec *ExecutionContext) GetDockerCommander() docker.DockerCommander
- func (ec *ExecutionContext) GetOcCommander() *oc.OcRunner
- func (ec *ExecutionContext) GetSSHCommander() provision.SSHCommander
- func (ec *ExecutionContext) Interpolate(cmd string) string
- func (ec *ExecutionContext) RemoveFromContext(key string) error
- func (ec *ExecutionContext) Vars() []string
- type InterpolationContext
- type OcCommand
- type OpenShiftCommand
- type SSHCommand
- type SleepCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // Executes the command Execute(ec *ExecutionContext) error // String returns a string representation of the command String() string }
Command defines a single command to be executes as part of an addon definition. Minishift supports various types of commands as part of its addon DSL, eg oc, openshift or docker commands.
type DockerCommand ¶
type DockerCommand struct {
// contains filtered or unexported fields
}
func NewDockerCommand ¶
func NewDockerCommand(command string) *DockerCommand
func (DockerCommand) Execute ¶
func (c DockerCommand) Execute(ec *ExecutionContext) error
type EchoCommand ¶
type EchoCommand struct {
// contains filtered or unexported fields
}
func NewEchoCommand ¶
func NewEchoCommand(command string) *EchoCommand
func (EchoCommand) Execute ¶
func (c EchoCommand) Execute(ec *ExecutionContext) error
type ExecutionContext ¶
type ExecutionContext struct { InterpolationContext // contains filtered or unexported fields }
ExecutionContext contains the mapping of supported addon variables to their values as well as access to ssh and other needed resources to execute commands.
func NewExecutionContext ¶
func NewExecutionContext(ocRunner *oc.OcRunner, sshCommander provision.SSHCommander) (*ExecutionContext, error)
NewExecutionContext creates a new execution context to be used with addon execution
func (*ExecutionContext) AddToContext ¶
func (ec *ExecutionContext) AddToContext(key string, value string) error
func (*ExecutionContext) GetDockerCommander ¶
func (ec *ExecutionContext) GetDockerCommander() docker.DockerCommander
GetDockerCommander returns a commander to run docker commands against the docker daemon used by Minishift
func (*ExecutionContext) GetOcCommander ¶
func (ec *ExecutionContext) GetOcCommander() *oc.OcRunner
GetSSHCommander returns a ssh commander to execute ssh commands against the Minishift VM
func (*ExecutionContext) GetSSHCommander ¶
func (ec *ExecutionContext) GetSSHCommander() provision.SSHCommander
GetSSHCommander returns a ssh commander to execute ssh commands against the Minishift VM
func (*ExecutionContext) Interpolate ¶
func (ec *ExecutionContext) Interpolate(cmd string) string
func (*ExecutionContext) RemoveFromContext ¶
func (ec *ExecutionContext) RemoveFromContext(key string) error
func (*ExecutionContext) Vars ¶ added in v1.3.0
func (ec *ExecutionContext) Vars() []string
type InterpolationContext ¶
type InterpolationContext interface { // AddToContext adds the specified value under the the specified key for command interpolation AddToContext(key string, value string) error // RemoveFromContext removes the specified value from the context RemoveFromContext(key string) error // Interpolate the cmd in the current context Interpolate(cmd string) string // Keys returns a list of variables available for interpolation in a sorted slice Vars() []string }
InterpolationContext allows to interpolate variables within commands
func NewInterpolationContext ¶
func NewInterpolationContext() InterpolationContext
NewInterpolationContext creates a new interpolation context
type OcCommand ¶
type OcCommand struct {
// contains filtered or unexported fields
}
func NewOcCommand ¶
func (OcCommand) Execute ¶
func (c OcCommand) Execute(ec *ExecutionContext) error
type OpenShiftCommand ¶
type OpenShiftCommand struct {
// contains filtered or unexported fields
}
func NewOpenShiftCommand ¶
func NewOpenShiftCommand(command string) *OpenShiftCommand
func (OpenShiftCommand) Execute ¶
func (c OpenShiftCommand) Execute(ec *ExecutionContext) error
type SSHCommand ¶
type SSHCommand struct {
// contains filtered or unexported fields
}
func NewSshCommand ¶
func NewSshCommand(command string) *SSHCommand
func (SSHCommand) Execute ¶
func (c SSHCommand) Execute(ec *ExecutionContext) error
type SleepCommand ¶
type SleepCommand struct {
// contains filtered or unexported fields
}
func NewSleepCommand ¶
func NewSleepCommand(command string) *SleepCommand
func (SleepCommand) Execute ¶
func (c SleepCommand) Execute(ec *ExecutionContext) error