# Go workspace builder API

Source: https://libtmux.org/en/go/latest/workspace/reference/

> Internal reference for the Go workspace builder and configuration APIs.

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 configuration

[`Parse`](./workspace-parse/) reads YAML into a
[`Workspace`](./workspace-workspace/). Its errors match
`ErrInvalidWorkspace`. Inspect the individual diagnostics to locate unknown
keys or invalid values.

[`Window`](./workspace-window/),
[`Pane`](./workspace-pane/), and
[`Command`](./workspace-command/) let applications construct the
same data in Go. `Bool` preserves tmuxp's supported boolean spellings.

## Build a session

[`Build`](./workspace-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`](./workspace-buildinto/) populates a supplied session
and preserves the caller's connection ownership.
`Workspace.InitialSessionRequest`
produces the initial request for that workflow.

## Inspect before and after

`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](https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/workspace/builder.go); [Configuration contracts](https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/workspace/workspace.go).

## API declarations

- [workspace.Bool](https://libtmux.org/en/go/latest/workspace/reference/workspace-bool/)
- [workspace.Build](https://libtmux.org/en/go/latest/workspace/reference/workspace-build/)
- [workspace.BuildInto](https://libtmux.org/en/go/latest/workspace/reference/workspace-buildinto/)
- [workspace.Command](https://libtmux.org/en/go/latest/workspace/reference/workspace-command/)
- [workspace.ErrInvalidWorkspace](https://libtmux.org/en/go/latest/workspace/reference/workspace-errinvalidworkspace/)
- [workspace.Pane](https://libtmux.org/en/go/latest/workspace/reference/workspace-pane/)
- [workspace.Parse](https://libtmux.org/en/go/latest/workspace/reference/workspace-parse/)
- [workspace.Window](https://libtmux.org/en/go/latest/workspace/reference/workspace-window/)
- [workspace.Workspace](https://libtmux.org/en/go/latest/workspace/reference/workspace-workspace/)
