Documentation ¶
Index ¶
- Constants
- func GetExecOptions(stream *streamv1.Stream) (command []string, input, tty bool, err error)
- func NewExecStream(command []string, input, tty bool) *streamv1.Stream
- type Agent
- type ExitCode
- type Message
- type MessageType
- type Resize
- type StderrData
- type StdinData
- type StdoutData
- type Terminal
- type TerminalSession
Constants ¶
View Source
const ( StdinDataFlag byte = iota StdoutDataFlag StderrDataFlag ResizeFlag ExitCodeFlag )
View Source
const ( AnnoCommand = "scaf/exec-command" AnnoInputEnabled = "scaf/exec-input-enabled" AnnoTTY = "scaf/exec-tty" )
表示 exec 参数的注解
Variables ¶
This section is empty.
Functions ¶
func GetExecOptions ¶
GetExecOptions 通过流获取 exec 选项
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent exec 代理
type ExitCode ¶
type ExitCode int32
ExitCode 退出码
func (ExitCode) Type ¶
func (e ExitCode) Type() MessageType
type Message ¶
type Message interface { // Type 返回消息类型 Type() MessageType // Raw 返回消息原始数据 Raw() []byte }
Message 消息
type MessageType ¶
type MessageType string
MessageType 消息类型
const ( StdinDataType MessageType = "StdinData" StdoutDataType MessageType = "StdoutData" StderrDataType MessageType = "StderrData" ResizeType MessageType = "Resize" ExitCodeType MessageType = "ExitCode" )
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal exec 终端
type TerminalSession ¶
type TerminalSession struct {
// contains filtered or unexported fields
}
func NewTerminalSession ¶
func NewTerminalSession( conn streams.Connection, stdin io.Reader, stdout, stderr io.Writer, input bool, ) *TerminalSession
NewTerminalSession 创建 *TerminalSession
func (*TerminalSession) HandleConn ¶
func (s *TerminalSession) HandleConn(ctx context.Context)
HandleConn 处理连接 只能调用一次
func (*TerminalSession) HandleConnDone ¶
func (s *TerminalSession) HandleConnDone() <-chan struct{}
HandleConnDone 返回处理连接完成通知通道
func (*TerminalSession) HandleInput ¶
func (s *TerminalSession) HandleInput(ctx context.Context)
HandleInput 处理输入 只能调用一次
func (*TerminalSession) HandleInputDone ¶
func (s *TerminalSession) HandleInputDone() <-chan struct{}
HandleInputDone 返回处理输入完成通知通道
Click to show internal directories.
Click to hide internal directories.