config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfigFile added in v0.10.0

func SetConfigFile(path string)

SetConfigFile sets an explicit config file path for Load to use instead of the default $HOME/.tix.yml. Passing an empty string restores the default.

Types

type Repository

type Repository struct {
	Name          string         `yaml:"name" mapstructure:"name"`
	Directory     string         `yaml:"directory" mapstructure:"directory"`
	DefaultLabels string         `yaml:"default_labels" mapstructure:"default_labels"`
	ReadyLabel    string         `yaml:"ready_label" mapstructure:"ready_label"`
	ReadyStatus   string         `yaml:"ready_status" mapstructure:"ready_status"`
	UnreadyLabel  string         `yaml:"unready_label" mapstructure:"unready_label"`
	UnreadyStatus string         `yaml:"unready_status" mapstructure:"unready_status"`
	GithubRepo    string         `yaml:"github_repo" mapstructure:"github_repo"`
	GitlabRepo    string         `yaml:"gitlab_repo" mapstructure:"gitlab_repo"`
	DefaultBranch string         `yaml:"default_branch" mapstructure:"default_branch"`
	Worktree      WorktreeConfig `yaml:"worktree,omitempty" mapstructure:"worktree"`
}

Repository represents a single repository configuration

func (*Repository) IsCodeRepo added in v0.6.1

func (r *Repository) IsCodeRepo() bool

IsCodeRepo returns true if the repository has a directory configured (i.e., it's a code repo)

type Settings

type Settings struct {
	ReadyLabel    string         `yaml:"ready_label" mapstructure:"ready_label"`
	ReadyStatus   string         `yaml:"ready_status" mapstructure:"ready_status"`
	UnreadyLabel  string         `yaml:"unready_label" mapstructure:"unready_label"`
	UnreadyStatus string         `yaml:"unready_status" mapstructure:"unready_status"`
	Worktree      WorktreeConfig `yaml:"worktree,omitempty" mapstructure:"worktree"`
	Repositories  []Repository   `yaml:"repositories" mapstructure:"repositories"`
}

Settings represents the root configuration

func Load

func Load() (*Settings, error)

Load reads the configuration from the specified file

func (*Settings) FindRepoForDir added in v0.10.0

func (s *Settings) FindRepoForDir(dir string) *Repository

FindRepoForDir returns the code repository whose directory contains dir, or nil if none does. Non-code repos (those without a directory) are ignored. When repositories are nested, the most deeply nested match wins.

func (*Settings) GetRepo

func (s *Settings) GetRepo(name string) *Repository

GetRepo returns a repository by name

func (*Settings) GetRepoNames

func (s *Settings) GetRepoNames() []string

GetRepoNames returns a list of repository names

func (*Settings) ResolveDefaultBranch added in v0.7.0

func (s *Settings) ResolveDefaultBranch(repo *Repository) string

ResolveDefaultBranch returns the default branch for a repo. Resolution order: per-repo worktree > per-repo default branch > global worktree > "main"

func (*Settings) ResolveWorktreePath added in v0.7.0

func (s *Settings) ResolveWorktreePath(repo *Repository) string

ResolveWorktreePath returns the worktree base path for a repo. Resolution order: per-repo > global > default (<repo-dir>/.worktrees)

type WorktreeConfig added in v0.7.0

type WorktreeConfig struct {
	Path          string `yaml:"path" mapstructure:"path"`
	DefaultBranch string `yaml:"default_branch" mapstructure:"default_branch"`
}

WorktreeConfig represents worktree configuration

Jump to

Keyboard shortcuts

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