Documentation
¶
Index ¶
Constants ¶
const ( ScreenActionTakeOver = "take_over" ScreenActionHandBack = "hand_back" )
The screen control actions a person's POST carries.
const Path = "/terminal/"
Path is where the daemon's binding listener serves the terminal.
const ScreenPath = "/screen/"
ScreenPath is where the daemon's binding listener serves a session's latest screen frame: GET ScreenPath?id=<session> with the binding token as a bearer, and POST ScreenPath?id=<session> to take the screen over, drive it or hand it back with the same bearer.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Screen ¶ added in v0.244.0
type Screen struct {
Token string
ClientCerts bool
Frame func(ctx context.Context, sessionID string) (*agentdomain.Frame, error)
Control func(ctx context.Context, sessionID, action string) (*ScreenOutcome, error)
Input func(ctx context.Context, sessionID string, input json.RawMessage) (*ScreenOutcome, error)
}
Screen serves the latest screen frame of a session's worker as an image, for the web terminal's live view, and its take-over: the control action and the person's inputs while held. Frame asks the daemon for it wherever the session runs. Control and Input relay to the same worker, the input as the raw JSON of the worker's ScreenInput contract, which the worker validates.
type ScreenOutcome ¶ added in v0.245.0
ScreenOutcome is the worker's answer to a screen control or input call: the screen's held state after it and what failed, if it came to that.
type Terminal ¶ added in v0.244.0
type Terminal struct {
Token string
ClientCerts bool
Command func(sessionID string) *exec.Cmd
// contains filtered or unexported fields
}
Terminal serves the browser terminal under Path on the daemon's binding listener: the xterm page, and one PTY per socket running Command on a session id of the tab's own, which the tab learns from the init reply. A token matching Token, or a verified client certificate when ClientCerts is set, authorizes a socket.