terminal

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPs1

func GetPs1(p []byte) string

func ParseCmdInput

func ParseCmdInput(p []byte) string

func ParseCmdOutput

func ParseCmdOutput(p []byte) string

Types

type CmdStruct

type CmdStruct struct {
	CommandID string
	Mode      string
	Msg       []byte
	PS1       string
}

type ReplyRecorder

type ReplyRecorder struct {
	AbsGzFilePath string
	// contains filtered or unexported fields
}

func NewReplyRecord

func NewReplyRecord(sid, shell string) (recorder ReplyRecorder)

func (*ReplyRecorder) End

func (r *ReplyRecorder) End()

func (*ReplyRecorder) Record

func (r *ReplyRecorder) Record(b []byte)

type StreamHandler

type StreamHandler struct {
	SessionID   string
	WsConn      *utils.WsConnection
	ResizeEvent chan remotecommand.TerminalSize
	Shell       string
	// contains filtered or unexported fields
}

StreamHandler ssh流式处理器

func (*StreamHandler) Close

func (handler *StreamHandler) Close() error

func (*StreamHandler) CommandRecordChan

func (handler *StreamHandler) CommandRecordChan()

func (*StreamHandler) Next

func (handler *StreamHandler) Next() (size *remotecommand.TerminalSize)

Next executor回调获取web是否resize

func (*StreamHandler) Read

func (handler *StreamHandler) Read(p []byte) (size int, err error)

Read executor回调读取web端的输入

func (*StreamHandler) Write

func (handler *StreamHandler) Write(p []byte) (size int, err error)

Write executor回调向web端输出

type WebTerminal

type WebTerminal struct {
	K8sClient *kubernetes.Clientset
	PodName   string
	Namespace string
	Container string
	Shell     string
}

func (*WebTerminal) NewSshSPDYExecutor

func (wt *WebTerminal) NewSshSPDYExecutor() *rest.Request

Jump to

Keyboard shortcuts

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