command

package
v2.1.23+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

View Source
const (
	PROTOCOL_TTY string = "tty"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCommand

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

func NewBaseCommand

func NewBaseCommand(name string, args ...string) *BaseCommand

func (*BaseCommand) AppendArgs

func (c *BaseCommand) AppendArgs(args ...string) *BaseCommand

func (BaseCommand) Cleanup

func (c BaseCommand) Cleanup() error

func (BaseCommand) GetCommand

func (c BaseCommand) GetCommand() *exec.Cmd

func (BaseCommand) GetData

func (c BaseCommand) GetData(comand string) (isShow bool, ouput string, command string)

func (BaseCommand) ShowInfo

func (c BaseCommand) ShowInfo() string

type ICommand

type ICommand interface {
	GetProtocol() string
	GetCommand() *exec.Cmd
	Cleanup() error
	GetData(string) (isShow bool, ouput string, command string)
	ShowInfo() string
}

func NewPodBashCommand

func NewPodBashCommand(kubeconfig, namespace, pod, container string) ICommand

func NewPodLogCommand

func NewPodLogCommand(kubeconfig, namespace, pod, container string) ICommand

type IpmiInfo

type IpmiInfo struct {
	IpAddr   string `json:"ip_addr"`
	Username string `json:"username"`
	Password string `json:"password"`
	Present  bool   `json:"present"`
}

type IpmitoolSol

type IpmitoolSol struct {
	*BaseCommand
	Info *IpmiInfo
}

func NewIpmitoolSolCommand

func NewIpmitoolSolCommand(info *IpmiInfo) (*IpmitoolSol, error)

func (*IpmitoolSol) GetCommand

func (c *IpmitoolSol) GetCommand() *exec.Cmd

func (IpmitoolSol) GetProtocol

func (c IpmitoolSol) GetProtocol() string

type Kubectl

type Kubectl struct {
	*BaseCommand
	// contains filtered or unexported fields
}

func NewKubectlCommand

func NewKubectlCommand(kubeconfig, namespace string) *Kubectl

func (*Kubectl) Cleanup

func (c *Kubectl) Cleanup() error

func (*Kubectl) Exec

func (c *Kubectl) Exec() *KubectlExec

func (*Kubectl) GetCommand

func (c *Kubectl) GetCommand() *exec.Cmd

func (Kubectl) GetProtocol

func (c Kubectl) GetProtocol() string

func (*Kubectl) Logs

func (c *Kubectl) Logs() *KubectlLog

type KubectlExec

type KubectlExec struct {
	*Kubectl
}

func (*KubectlExec) Command

func (c *KubectlExec) Command(cmd string, args ...string) *KubectlExec

func (*KubectlExec) Container

func (c *KubectlExec) Container(name string) *KubectlExec

func (*KubectlExec) Pod

func (c *KubectlExec) Pod(name string) *KubectlExec

func (*KubectlExec) Stdin

func (c *KubectlExec) Stdin() *KubectlExec

func (*KubectlExec) TTY

func (c *KubectlExec) TTY() *KubectlExec

type KubectlLog

type KubectlLog struct {
	*Kubectl
}

func (*KubectlLog) Container

func (c *KubectlLog) Container(name string) *KubectlLog

func (*KubectlLog) Follow

func (c *KubectlLog) Follow() *KubectlLog

func (*KubectlLog) Pod

func (c *KubectlLog) Pod(name string) *KubectlLog

type SSHtoolSol

type SSHtoolSol struct {
	*BaseCommand
	IP       string
	Username string
	// contains filtered or unexported fields
}

func NewSSHtoolSolCommand

func NewSSHtoolSolCommand(ip string) (*SSHtoolSol, error)

func (*SSHtoolSol) Cleanup

func (c *SSHtoolSol) Cleanup() error

func (*SSHtoolSol) GetCommand

func (c *SSHtoolSol) GetCommand() *exec.Cmd

func (*SSHtoolSol) GetData

func (c *SSHtoolSol) GetData(data string) (isShow bool, ouput string, command string)

func (*SSHtoolSol) GetProtocol

func (c *SSHtoolSol) GetProtocol() string

func (*SSHtoolSol) ShowInfo

func (c *SSHtoolSol) ShowInfo() string

Jump to

Keyboard shortcuts

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