Documentation
¶
Overview ¶
Package workspace models an editable KBot Studio workspace: a writable work folder overlaid on top of a kbot context (and that context's parent chain).
A workspace is described by a YAML manifest (workspace.yaml) stored in the work folder, which makes it portable and self-describing. The kbot config at ~/.kbot keeps a lightweight recents index pointing at workspaces; the manifest is the source of truth.
Index ¶
- Constants
- func ContextSources(cfg *kbotctx.Config, alias string) ([]filesystem.Source, error)
- func DefaultExportFormat(game string) string
- type Export
- type Manifest
- func (m *Manifest) Dir() string
- func (m *Manifest) ManifestPath() string
- func (m *Manifest) OpenVFS(cfg *kbotctx.Config, fsConfig *filesystem.Config) (*filesystem.VirtualFileSystem, error)
- func (m *Manifest) Ref() kbotctx.WorkspaceRef
- func (m *Manifest) ResolveSources(cfg *kbotctx.Config) ([]filesystem.Source, error)
- func (m *Manifest) Save() error
- type Mod
Constants ¶
const ( ExportHPIv1 = "hpi-v1" // Total Annihilation archives ExportHPIv2 = "hpi-v2" // TA: Kingdoms archives )
Export format identifiers for "Export Mod".
const ManifestName = "workspace.yaml"
ManifestName is the basename of the workspace manifest within a work folder.
const WorkspaceLabel = "Workspace"
WorkspaceLabel is the VFS layer label used for the writable overlay.
Variables ¶
This section is empty.
Functions ¶
func ContextSources ¶
ContextSources builds the read-only VFS source stack for a context alias and its parent chain (highest priority first), with no writable overlay. Used for opening a context for browsing without a workspace.
func DefaultExportFormat ¶
DefaultExportFormat returns the natural archive format for a game flavour.
Types ¶
type Export ¶
type Export struct {
Format string `yaml:"format,omitempty"`
}
Export configures how the workspace is packaged by "Export Mod".
type Manifest ¶
type Manifest struct {
Name string `yaml:"name"`
Base string `yaml:"base"`
Game string `yaml:"game,omitempty"`
Mod Mod `yaml:"mod,omitempty"`
Export Export `yaml:"export,omitempty"`
// contains filtered or unexported fields
}
Manifest is the on-disk shape of workspace.yaml.
func New ¶
New builds a manifest for a work folder layered on a base context, filling in the game flavour and export format from the context when not provided.
func (*Manifest) ManifestPath ¶
ManifestPath returns the full path to the workspace's manifest file.
func (*Manifest) OpenVFS ¶
func (m *Manifest) OpenVFS(cfg *kbotctx.Config, fsConfig *filesystem.Config) (*filesystem.VirtualFileSystem, error)
OpenVFS resolves the workspace's source stack and opens a writable VFS over it.
func (*Manifest) Ref ¶
func (m *Manifest) Ref() kbotctx.WorkspaceRef
Ref returns the recents-index entry for this workspace.
func (*Manifest) ResolveSources ¶
ResolveSources builds the ordered VFS source stack for this workspace: the writable work folder on top, then the base context and its parent chain (highest priority first). It fails if the base context (or chain) is invalid.