command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute() (stderr []byte, stdout []byte, err error)
	GetCommand() string // Get execute command
}

func NewKubectlCommand

func NewKubectlCommand(machine machine.IMachine, kubeConfigPath string, ns string, subCommands ...string) Command

type Exists

type Exists interface {
	Exists() (bool, error)
}

type KubectlCommand

type KubectlCommand struct {
	*ShellCommand
	// contains filtered or unexported fields
}

KubectlCommand is a command execute by kubectl

type LocalShellCommand

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

func NewLocalShellCommand

func NewLocalShellCommand(cmd string, args ...string) *LocalShellCommand

func (*LocalShellCommand) Execute

func (c *LocalShellCommand) Execute() (stderr, stdout []byte, err error)

func (*LocalShellCommand) Exists

func (c *LocalShellCommand) Exists() (isExist bool, err error)

func (*LocalShellCommand) GetCommand

func (c *LocalShellCommand) GetCommand() string

type ShellCommand

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

ShellCommand is a command execute by shell

func NewShellCommand

func NewShellCommand(machine machine.IMachine, cmd string, args ...string) *ShellCommand

func (*ShellCommand) Execute

func (c *ShellCommand) Execute() (stdout, stderr []byte, err error)

func (*ShellCommand) Exists

func (c *ShellCommand) Exists() (isExist bool, err error)

func (*ShellCommand) GetCommand

func (c *ShellCommand) GetCommand() string

func (*ShellCommand) WithDescription

func (c *ShellCommand) WithDescription(desc string) *ShellCommand

func (*ShellCommand) WithExecuteLogWriter

func (c *ShellCommand) WithExecuteLogWriter(w io.Writer) *ShellCommand

Jump to

Keyboard shortcuts

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