recorder

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecordingStatusActive    = proxy.RecordingStatusActive
	RecordingStatusRecording = proxy.RecordingStatusRecording
	RecordingStatusPaused    = proxy.RecordingStatusPaused
	RecordingStatusStopped   = proxy.RecordingStatusStopped
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AscicastV2Event

type AscicastV2Event struct {
	Timestamp float64 `json:"0"` // 相对时间(秒)
	Type      string  `json:"1"` // "o" 或 "i"
	Data      string  `json:"2"` // 数据内容
}

AscicastV2Event asciicast v2 事件结构

type AscicastV2Header

type AscicastV2Header struct {
	Version   int               `json:"version"`
	Width     int               `json:"width"`
	Height    int               `json:"height"`
	Timestamp int64             `json:"timestamp"`
	Title     string            `json:"title,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
}

AscicastV2Header asciicast v2 头部结构

type Recorder

type Recorder = proxy.Recorder

type RecorderFactory

type RecorderFactory = proxy.RecorderFactory

type RecordingStatus

type RecordingStatus = proxy.RecordingStatus

从 proxy 包导入公共类型和接口

type SSHRecorder

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

SSHRecorder SSH 会话录制器(asciicast v2 格式)

func NewSSHRecorder

func NewSSHRecorder(storage audit.ObjectStorage, width, height int) *SSHRecorder

NewSSHRecorder 创建 SSH 录制器

func (*SSHRecorder) GetData

func (r *SSHRecorder) GetData() []byte

GetData 获取录制数据(用于测试)

func (*SSHRecorder) Protocol

func (r *SSHRecorder) Protocol() audit.Protocol

Protocol 实现 Recorder 接口

func (*SSHRecorder) Start

func (r *SSHRecorder) Start(ctx context.Context, sessionID string, metadata map[string]interface{}) error

Start 开始录制

func (*SSHRecorder) Status

func (r *SSHRecorder) Status() RecordingStatus

Status 获取录制状态

func (*SSHRecorder) Stop

func (r *SSHRecorder) Stop(ctx context.Context) (string, error)

Stop 结束录制

func (*SSHRecorder) Write

func (r *SSHRecorder) Write(timestamp float64, ioType rune, data []byte) error

Write 写入数据

type StreamingSSHRecorder

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

StreamingSSHRecorder 流式 SSH 录制器(边录边传)

func NewStreamingSSHRecorder

func NewStreamingSSHRecorder(storage audit.ObjectStorage, width, height int) *StreamingSSHRecorder

NewStreamingSSHRecorder 创建流式录制器

func (*StreamingSSHRecorder) Start

func (r *StreamingSSHRecorder) Start(ctx context.Context, sessionID string, metadata map[string]interface{}) error

Start 开始流式录制

func (*StreamingSSHRecorder) Stop

Stop 停止录制

func (*StreamingSSHRecorder) Write

func (r *StreamingSSHRecorder) Write(timestamp float64, ioType rune, data []byte) error

Jump to

Keyboard shortcuts

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