command

package
v0.3.9-2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 19 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(s *mcclient.ClientSession, 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) GetClientSession

func (c *BaseCommand) GetClientSession() *mcclient.ClientSession

func (BaseCommand) GetCommand

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

func (BaseCommand) GetRecordObject

func (c BaseCommand) GetRecordObject() *recorder.Object

func (BaseCommand) IsNeedShowInfo

func (c BaseCommand) IsNeedShowInfo() bool

func (BaseCommand) Reconnect

func (c BaseCommand) Reconnect()

func (BaseCommand) Scan

func (c BaseCommand) Scan(byte, func(msg string))

func (BaseCommand) ShowInfo

func (c BaseCommand) ShowInfo() string

type ICommand

type ICommand interface {
	GetProtocol() string
	GetCommand() *exec.Cmd
	Cleanup() error
	Reconnect()
	IsNeedShowInfo() bool
	ShowInfo() string
	Scan(d byte, send func(msg string))
	GetClientSession() *mcclient.ClientSession
	GetRecordObject() *recorder.Object
}

func NewPodBashCommand

func NewPodBashCommand(env *K8sEnv) ICommand

func NewPodLogCommand

func NewPodLogCommand(env *K8sEnv) 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
	// contains filtered or unexported fields
}

func NewIpmitoolSolCommand

func NewIpmitoolSolCommand(info *IpmiInfo, s *mcclient.ClientSession) (*IpmitoolSol, error)

func (*IpmitoolSol) GetCommand

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

func (IpmitoolSol) GetProtocol

func (c IpmitoolSol) GetProtocol() string

type K8sEnv

type K8sEnv struct {
	Session    *mcclient.ClientSession
	Cluster    string
	Namespace  string
	Pod        string
	Container  string
	Kubeconfig string
	Data       jsonutils.JSONObject
}

type Kubectl

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

func NewKubectlCommand

func NewKubectlCommand(s *mcclient.ClientSession, 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

func (*KubectlLog) Since

func (c *KubectlLog) Since(data jsonutils.JSONObject) *KubectlLog

type SSHtoolSol

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

func NewSSHtoolSolCommand

func NewSSHtoolSolCommand(ctx context.Context, us *mcclient.ClientSession, ip string, body jsonutils.JSONObject) (*SSHtoolSol, error)

func (*SSHtoolSol) Cleanup

func (c *SSHtoolSol) Cleanup() error

func (*SSHtoolSol) Connect

func (c *SSHtoolSol) Connect() error

func (*SSHtoolSol) GetClientSession

func (c *SSHtoolSol) GetClientSession() *mcclient.ClientSession

func (*SSHtoolSol) GetCommand

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

func (*SSHtoolSol) GetProtocol

func (c *SSHtoolSol) GetProtocol() string

func (*SSHtoolSol) GetRecordObject

func (c *SSHtoolSol) GetRecordObject() *recorder.Object

func (*SSHtoolSol) IsNeedShowInfo

func (c *SSHtoolSol) IsNeedShowInfo() bool

func (*SSHtoolSol) Reconnect

func (c *SSHtoolSol) Reconnect()

func (*SSHtoolSol) Scan

func (c *SSHtoolSol) Scan(d byte, send func(msg 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