command

package
v1.34.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 14 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatCommand added in v1.25.0

type CatCommand struct {
	// contains filtered or unexported fields
}

func NewCatCommand added in v1.25.0

func NewCatCommand(command string, ignoreError bool, outputVariable string) *CatCommand

func (CatCommand) Execute added in v1.25.0

func (c CatCommand) Execute(ec *ExecutionContext) error

func (CatCommand) IgnoreError added in v1.25.0

func (c CatCommand) IgnoreError() bool

func (CatCommand) String added in v1.25.0

func (c CatCommand) String() string

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 executed 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, ignoreError bool, outputVariable string) *DockerCommand

func (DockerCommand) Execute

func (c DockerCommand) Execute(ec *ExecutionContext) error

func (DockerCommand) IgnoreError added in v1.15.0

func (c DockerCommand) IgnoreError() bool

func (DockerCommand) String

func (c DockerCommand) String() string

type EchoCommand

type EchoCommand struct {
	// contains filtered or unexported fields
}

func NewEchoCommand

func NewEchoCommand(command string, ignoreError bool) *EchoCommand

func (EchoCommand) Execute

func (c EchoCommand) Execute(ec *ExecutionContext) error

func (EchoCommand) IgnoreError added in v1.15.0

func (c EchoCommand) IgnoreError() bool

func (EchoCommand) String

func (c EchoCommand) String() string

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 VM

func (*ExecutionContext) GetOcCommander

func (ec *ExecutionContext) GetOcCommander() *oc.OcRunner

GetOcCommander returns a commander to run oc 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 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 NewOcCommand(command string, ignoreError bool, outputVariable string) *OcCommand

func (OcCommand) Execute

func (c OcCommand) Execute(ec *ExecutionContext) error

func (OcCommand) IgnoreError added in v1.15.0

func (c OcCommand) IgnoreError() bool

func (OcCommand) String

func (c OcCommand) String() string

type OpenShiftCommand

type OpenShiftCommand struct {
	// contains filtered or unexported fields
}

func NewOpenShiftCommand

func NewOpenShiftCommand(command string, ignoreError bool, outputVariable string) *OpenShiftCommand

func (OpenShiftCommand) Execute

func (c OpenShiftCommand) Execute(ec *ExecutionContext) error

func (OpenShiftCommand) IgnoreError added in v1.15.0

func (c OpenShiftCommand) IgnoreError() bool

func (OpenShiftCommand) String

func (c OpenShiftCommand) String() string

type SSHCommand

type SSHCommand struct {
	// contains filtered or unexported fields
}

func NewSshCommand

func NewSshCommand(command string, ignoreError bool, outputVariable string) *SSHCommand

func (SSHCommand) Execute

func (c SSHCommand) Execute(ec *ExecutionContext) error

func (SSHCommand) IgnoreError added in v1.15.0

func (c SSHCommand) IgnoreError() bool

func (SSHCommand) String

func (c SSHCommand) String() string

type SleepCommand

type SleepCommand struct {
	// contains filtered or unexported fields
}

func NewSleepCommand

func NewSleepCommand(command string, ignoreError bool) *SleepCommand

func (SleepCommand) Execute

func (c SleepCommand) Execute(ec *ExecutionContext) error

func (SleepCommand) IgnoreError added in v1.15.0

func (c SleepCommand) IgnoreError() bool

func (SleepCommand) String

func (c SleepCommand) String() string

Jump to

Keyboard shortcuts

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