github.com/libtmux/libtmux-go/workspace · Source
The workspace module takes core tmux.Server and session handles. Parsing
is independent of a running server; building takes a context for deadlines
and cancellation.
Parse configurationLink to section
Parse reads YAML into a
Workspace. Its errors match
ErrInvalidWorkspace. Inspect the individual diagnostics to locate unknown
keys or invalid values.
Window,
Pane, and
Command let applications construct the
same data in Go. Bool preserves tmuxp’s supported boolean spellings.
Build a sessionLink to section
Build creates the initial session and owns
a temporary control connection for the duration of construction. It returns
a session and an error; a non-nil error can accompany a partial session.
BuildInto populates a supplied session
and preserves the caller’s connection ownership.
Workspace.InitialSessionRequest
produces the initial request for that workflow.
Inspect before and afterLink to section
Workspace.MissingDirectories reports working directories absent on the
current machine. It does not make them validation errors. After construction,
inspect live state through the core API rather than reading relations from
the creation handle.
Build contracts; Configuration contracts.
API declarations
Follow a declaration for its signature, members, documentation, and source.
Exports
workspace.Bool- Bool accepts YAML booleans and tmuxp's quoted spellings. It is exported so callers can construct optional *Bool fields.
workspace.Build- Build creates the workspace on server and returns the created session.
workspace.BuildInto- BuildInto populates the initial session described by workspace. The session must already have been created from Workspace.InitialSessionRequest. BuildInto uses the session's existing server and transport; it neither creates a session nor opens or owns a connection.
workspace.Command- Command is one command to run in a pane. YAML accepts either a bare string or a mapping, so "echo hi" and {cmd: echo hi, sleep_before: 2} are both commands.
workspace.ErrInvalidWorkspace- ErrInvalidWorkspace matches parse and validation failures, but not tmux command failures from Build.
workspace.Pane- Pane is one pane in a window. YAML accepts either a bare command string or a mapping, so "echo hello" and {shell_command: echo hello} are equivalent.
workspace.Parse- Parse decodes one workspace document. Unknown fields are rejected so a misspelled key fails loudly instead of being dropped.
workspace.Window- Window is one window in a workspace.
workspace.Workspace- Workspace is one tmuxp-style session description.