Documentation
¶
Overview ¶
Package terminal provides WebSocket-based interactive terminal sessions.
Sessions are created via task execution and communicate bidirectionally with clients through a relay endpoint, using PTY for shell interaction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
// CreateSession creates a new terminal session with the given dimensions.
CreateSession(ctx context.Context, instanceID string, cols, rows uint16) (*Session, error)
// GetSession retrieves an active session by ID.
GetSession(sessionID string) (*Session, error)
// RemoveSession removes and cleans up a session.
RemoveSession(sessionID string)
// CleanupInactiveSessions removes sessions inactive for longer than the given timeout.
CleanupInactiveSessions(timeout time.Duration)
}
Manager handles terminal session lifecycle.
type Message ¶
type Message struct {
Action MessageAction `json:"action"`
Data string `json:"data,omitempty"`
Cols uint16 `json:"cols,omitempty"`
Rows uint16 `json:"rows,omitempty"`
Error string `json:"error,omitempty"`
}
type MessageAction ¶
type MessageAction string
const ( ActionInit MessageAction = "init" ActionInput MessageAction = "input" ActionResize MessageAction = "resize" ActionOutput MessageAction = "output" ActionError MessageAction = "error" ActionClose MessageAction = "close" )
Click to show internal directories.
Click to hide internal directories.