Documentation
¶
Overview ¶
Package state handles reading and writing space metadata to XDG data files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataDir ¶
func DataDir() string
DataDir returns the directory where space state files are stored: $XDG_DATA_HOME/wtg/spaces (default ~/.local/share/wtg/spaces).
func DataRoot ¶ added in v1.6.0
func DataRoot() string
DataRoot returns the wtg data directory, following the XDG Base Directory spec: $XDG_DATA_HOME/wtg (default ~/.local/share/wtg).
Types ¶
type RepoEntry ¶
type RepoEntry struct {
Name string `yaml:"name"` // short name relative to discovery.root_dir
RepoPath string `yaml:"repo_path"` // absolute path to the main clone
WorktreePath string `yaml:"worktree_path"` // absolute path to the linked worktree or symlink
Symlink bool `yaml:"symlink,omitempty"` // true if this entry is a symlink to the main clone
}
RepoEntry describes one repo's participation in a space.
type Space ¶
type Space struct {
Name string `yaml:"name"`
Path string `yaml:"path"` // absolute path to the workspace root
Branch string `yaml:"branch"` // branch shared across all repos
CreatedAt time.Time `yaml:"created_at"`
Repos []RepoEntry `yaml:"repos"`
GoWorkspace bool `yaml:"go_workspace"` // whether a go.work was written
}
Space holds the persisted metadata for a workspace.
Click to show internal directories.
Click to hide internal directories.