docker

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyLogs added in v3.2.5

func CopyLogs(dst io.Writer, src io.Reader, tty bool) error

CopyLogs 将容器日志流写入 dst。 非 TTY 容器的日志是多路复用流(每帧带 8 字节头),需用 stdcopy 解复用; 传入同一个 writer 作为 stdout/stderr 两路目标,以保持原始时序。 TTY 容器为裸流,直接拷贝即可。

Types

type MessageResize

type MessageResize struct {
	Resize  bool `json:"resize"`
	Columns uint `json:"columns"`
	Rows    uint `json:"rows"`
}

MessageResize 终端大小调整消息

type Turn

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

Turn 容器终端转发器

func NewTurn

func NewTurn(ctx context.Context, ws *websocket.Conn, containerID string, command []string, sock string) (*Turn, error)

NewTurn 创建容器终端转发器

func (*Turn) Close

func (t *Turn) Close()

Close 关闭连接

func (*Turn) Handle

func (t *Turn) Handle(ctx context.Context) error

Handle 处理 WebSocket 消息

func (*Turn) Wait

func (t *Turn) Wait()

Wait 等待容器输出并转发到 WebSocket

func (*Turn) Write

func (t *Turn) Write(p []byte) (n int, err error)

Write 实现 io.Writer 接口,将容器输出写入 WebSocket

Jump to

Keyboard shortcuts

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