stream

package
v0.0.0-...-2185df1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

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

Stream 流式处理

func New

func New(wsConn WebSocket) *Stream

New 生成实例

func (*Stream) Next

func (s *Stream) Next() *remotecommand.TerminalSize

Next 处理页面变化

func (*Stream) Read

func (s *Stream) Read(p []byte) (int, error)

Read 将前端页面的数据读入到 websocket 的管道中,写入 k8s exec

func (*Stream) Write

func (s *Stream) Write(p []byte) (int, error)

Write 将 k8s exec 的数据写入到 websocket 的管道中,返回给前端页面显示

type WebSocket

type WebSocket interface {
	WebsocketWrite(msgType int, data []byte) error
	WebsocketRead() (*socket.Message, error)
}

WebSocket 操作接口

Jump to

Keyboard shortcuts

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