command

package
v0.0.0-...-21b9e53 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 14 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) Scan

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

type ClimcSshCommand

type ClimcSshCommand struct {
	*BaseCommand
	Info *webconsole.ClimcSshInfo
	// contains filtered or unexported fields
}

func (ClimcSshCommand) Cleanup

func (c ClimcSshCommand) Cleanup() error

func (ClimcSshCommand) GetCommand

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

func (ClimcSshCommand) GetIPs

func (c ClimcSshCommand) GetIPs() []string

func (ClimcSshCommand) GetInstanceName

func (c ClimcSshCommand) GetInstanceName() string

func (ClimcSshCommand) GetProtocol

func (c ClimcSshCommand) GetProtocol() string

func (*ClimcSshCommand) Scan

func (c *ClimcSshCommand) Scan(d byte, send func(msg string))

type ICommand

type ICommand interface {
	GetProtocol() string
	GetCommand() *exec.Cmd
	Cleanup() error
	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

	// For display info
	InstanceName string
	IPs          []string
	// 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) GetIPs

func (c *Kubectl) GetIPs() []string

func (*Kubectl) GetInstanceName

func (c *Kubectl) GetInstanceName() string

func (Kubectl) GetProtocol

func (c Kubectl) GetProtocol() string

func (*Kubectl) Logs

func (c *Kubectl) Logs() *KubectlLog

func (*Kubectl) SetIPs

func (c *Kubectl) SetIPs(ips []string)

func (*Kubectl) SetInstanceName

func (c *Kubectl) SetInstanceName(name string)

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 SAdbShellCommand

type SAdbShellCommand struct {
	*BaseCommand
	Info *SAdbShellInfo
	// contains filtered or unexported fields
}

func NewAdbShellCommand

func NewAdbShellCommand(info *SAdbShellInfo, s *mcclient.ClientSession) (*SAdbShellCommand, error)

func (*SAdbShellCommand) Cleanup

func (c *SAdbShellCommand) Cleanup() error

func (*SAdbShellCommand) GetCommand

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

func (SAdbShellCommand) GetProtocol

func (c SAdbShellCommand) GetProtocol() string

type SAdbShellInfo

type SAdbShellInfo struct {
	HostIp   string `json:"host_ip"`
	HostPort int    `json:"host_port"`
}

type SocatCmd

type SocatCmd struct {
	*BaseCommand
	Info *SocatInfo
	// contains filtered or unexported fields
}

func NewSocatCommand

func NewSocatCommand(info *SocatInfo, s *mcclient.ClientSession) (*SocatCmd, error)

func (*SocatCmd) GetCommand

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

func (*SocatCmd) GetProtocol

func (c *SocatCmd) GetProtocol() string

type SocatInfo

type SocatInfo struct {
	IP   string `json:"ip"`
	Port int    `json:"port"`
}

Jump to

Keyboard shortcuts

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