podexec

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndOfTransmission = "\u0004"
)

Variables

This section is empty.

Functions

func ExecPod

func ExecPod(kubeClient kubernetes.Interface, cfg *rest.Config, cmd []string, ptyHandler PtyHandler, namespace, podName, containerName string) error

ExecPod do pod exec

func NewKubeOutClusterClient

func NewKubeOutClusterClient(clusterID string) (kubernetes.Interface, *rest.Config, error)

kubeclient config

func ValidatePod

func ValidatePod(kubeClient kubernetes.Interface, namespace, podName, containerName string) (bool, error)

验证是否存在

Types

type PtyHandler

type PtyHandler interface {
	io.Reader
	io.Writer
	remotecommand.TerminalSizeQueue
	Done() chan struct{}
}

type TerminalMessage

type TerminalMessage struct {
	Operation string `json:"operation"`
	Data      string `json:"data"`
	Rows      uint16 `json:"rows"`
	Cols      uint16 `json:"cols"`
}

TerminalMessage is the messaging protocol between ShellController and TerminalSession.

type TerminalSession

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

TerminalSession implements PtyHandler

func NewTerminalSession

func NewTerminalSession(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*TerminalSession, error)

func (*TerminalSession) Close

func (t *TerminalSession) Close() error

Close close session

func (*TerminalSession) Done

func (t *TerminalSession) Done() chan struct{}

Done done

func (*TerminalSession) Next

Next called in a loop from remotecommand as long as the process is running

func (*TerminalSession) Read

func (t *TerminalSession) Read(p []byte) (int, error)

Read called in a loop from remotecommand as long as the process is running

func (*TerminalSession) Write

func (t *TerminalSession) Write(p []byte) (int, error)

Write called from remotecommand whenever there is any output

Jump to

Keyboard shortcuts

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