config

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRepoDefaults

func ApplyRepoDefaults(repo *RepoConfig, defaults Defaults)

func GlobalConfigPath

func GlobalConfigPath() (string, error)

func SaveGlobal

func SaveGlobal(path string, cfg GlobalConfig) error

func SaveWorkspace

func SaveWorkspace(path string, cfg WorkspaceConfig) error

func WorkspaceExists

func WorkspaceExists(path string) (bool, error)

Types

type Defaults

type Defaults struct {
	BaseBranch        string      `yaml:"base_branch" json:"base_branch" mapstructure:"base_branch"`
	Workspace         string      `yaml:"workspace" json:"workspace" mapstructure:"workspace"`
	WorkspaceRoot     string      `yaml:"workspace_root" json:"workspace_root" mapstructure:"workspace_root"`
	RepoStoreRoot     string      `yaml:"repo_store_root" json:"repo_store_root" mapstructure:"repo_store_root"`
	SessionBackend    string      `yaml:"session_backend" json:"session_backend" mapstructure:"session_backend"`
	SessionNameFormat string      `yaml:"session_name_format" json:"session_name_format" mapstructure:"session_name_format"`
	SessionTheme      string      `yaml:"session_theme" json:"session_theme" mapstructure:"session_theme"`
	SessionTmuxStyle  string      `yaml:"session_tmux_status_style" json:"session_tmux_status_style" mapstructure:"session_tmux_status_style"`
	SessionTmuxLeft   string      `yaml:"session_tmux_status_left" json:"session_tmux_status_left" mapstructure:"session_tmux_status_left"`
	SessionTmuxRight  string      `yaml:"session_tmux_status_right" json:"session_tmux_status_right" mapstructure:"session_tmux_status_right"`
	SessionScreenHard string      `yaml:"session_screen_hardstatus" json:"session_screen_hardstatus" mapstructure:"session_screen_hardstatus"`
	Remotes           RemoteNames `yaml:"remotes" json:"remotes" mapstructure:"remotes"`
	Parallelism       int         `yaml:"parallelism" json:"parallelism" mapstructure:"parallelism"`
}

type GlobalConfig

type GlobalConfig struct {
	Defaults   Defaults                `yaml:"defaults" json:"defaults" mapstructure:"defaults"`
	Repos      map[string]RepoAlias    `yaml:"repos" json:"repos" mapstructure:"repos"`
	Groups     map[string]Group        `yaml:"groups" json:"groups" mapstructure:"groups"`
	Workspaces map[string]WorkspaceRef `yaml:"workspaces" json:"workspaces" mapstructure:"workspaces"`
}

func DefaultConfig

func DefaultConfig() GlobalConfig

func LoadGlobal

func LoadGlobal(path string) (GlobalConfig, error)

func (*GlobalConfig) EnsureMaps

func (cfg *GlobalConfig) EnsureMaps()

type Group

type Group struct {
	Description string        `yaml:"description" json:"description" mapstructure:"description"`
	Members     []GroupMember `yaml:"members" json:"members" mapstructure:"members"`
}

type GroupMember

type GroupMember struct {
	Repo    string  `yaml:"repo" json:"repo" mapstructure:"repo"`
	Remotes Remotes `yaml:"remotes" json:"remotes" mapstructure:"remotes"`
}

type RemoteConfig

type RemoteConfig struct {
	Name          string `yaml:"name" json:"name" mapstructure:"name"`
	DefaultBranch string `yaml:"default_branch,omitempty" json:"default_branch,omitempty" mapstructure:"default_branch"`
}

type RemoteNames

type RemoteNames struct {
	Base  string `yaml:"base" json:"base" mapstructure:"base"`
	Write string `yaml:"write" json:"write" mapstructure:"write"`
}

type Remotes

type Remotes struct {
	Base  RemoteConfig `yaml:"base" json:"base" mapstructure:"base"`
	Write RemoteConfig `yaml:"write" json:"write" mapstructure:"write"`
}

type RepoAlias

type RepoAlias struct {
	URL           string `yaml:"url,omitempty" json:"url,omitempty" mapstructure:"url"`
	Path          string `yaml:"path,omitempty" json:"path,omitempty" mapstructure:"path"`
	DefaultBranch string `yaml:"default_branch" json:"default_branch" mapstructure:"default_branch"`
}

type RepoConfig

type RepoConfig struct {
	Name      string  `yaml:"name" json:"name" mapstructure:"name"`
	LocalPath string  `yaml:"local_path" json:"local_path" mapstructure:"local_path"`
	Managed   bool    `yaml:"managed,omitempty" json:"managed,omitempty" mapstructure:"managed"`
	RepoDir   string  `yaml:"repo_dir" json:"repo_dir" mapstructure:"repo_dir"`
	Remotes   Remotes `yaml:"remotes" json:"remotes" mapstructure:"remotes"`
}

type WorkspaceConfig

type WorkspaceConfig struct {
	Name  string       `yaml:"name" json:"name" mapstructure:"name"`
	Repos []RepoConfig `yaml:"repos" json:"repos" mapstructure:"repos"`
}

func LoadWorkspace

func LoadWorkspace(path string) (WorkspaceConfig, error)

type WorkspaceRef

type WorkspaceRef struct {
	Path      string `yaml:"path" json:"path" mapstructure:"path"`
	CreatedAt string `yaml:"created_at,omitempty" json:"created_at,omitempty" mapstructure:"created_at"`
	LastUsed  string `yaml:"last_used,omitempty" json:"last_used,omitempty" mapstructure:"last_used"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL