config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package config loads and saves triage's settings and knows where triage keeps its files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save added in v0.2.0

func Save(path string, cfg Config) error

Save writes cfg to path atomically.

Types

type Config added in v0.2.0

type Config struct {
	// Repos are the repositories triage tracks, in owner/name form.
	Repos []string `toml:"repos"`
	// DefaultRepo receives new issues when triage can't tell which repo you
	// mean from the current directory.
	DefaultRepo string `toml:"default_repo,omitempty"`
	// RefreshMinutes is how often the app checks GitHub for changes.
	RefreshMinutes int `toml:"refresh_minutes,omitempty"`
	// Labels names the labels that carry type and status.
	Labels issue.Convention `toml:"labels"`
	// RepoColors picks colors for repos, by palette name or #rrggbb.
	RepoColors map[string]string `toml:"repo_colors,omitempty"`
	// ReduceMotion turns off animations such as the row glow and spinners.
	ReduceMotion bool `toml:"reduce_motion,omitempty"`
	// Views are extra saved filters shown after the built-in ones.
	Views []View `toml:"views,omitempty"`
}

Config is the contents of config.toml.

func Default added in v0.2.0

func Default() Config

Default returns the configuration used before the user sets anything.

func Load added in v0.2.0

func Load(path string) (cfg Config, exists bool, err error)

Load reads the config file. A missing file returns Default() and exists=false.

func (*Config) AddRepo added in v0.2.0

func (c *Config) AddRepo(repo string) bool

AddRepo tracks repo; it reports whether repo was new.

func (Config) HasRepo added in v0.2.0

func (c Config) HasRepo(repo string) bool

HasRepo reports whether repo is tracked.

func (Config) RefreshInterval added in v0.2.0

func (c Config) RefreshInterval() time.Duration

RefreshInterval returns how often to poll GitHub.

func (*Config) RemoveRepo added in v0.2.0

func (c *Config) RemoveRepo(repo string) bool

RemoveRepo stops tracking repo; it reports whether repo was tracked.

type Paths added in v0.2.0

type Paths struct {
	// ConfigDir holds config.toml and the outbox of unsent changes.
	ConfigDir string
	// CacheDir holds cached issues; deleting it loses nothing.
	CacheDir string
}

Paths are the locations triage reads and writes.

func DefaultPaths added in v0.2.0

func DefaultPaths() (Paths, error)

DefaultPaths returns the OS-specific locations, overridable with TRIAGE_CONFIG_DIR and TRIAGE_CACHE_DIR.

func (Paths) ConfigFile added in v0.2.0

func (p Paths) ConfigFile() string

func (Paths) OutboxDir added in v0.2.0

func (p Paths) OutboxDir() string

type View added in v0.2.0

type View struct {
	Name  string `toml:"name"`
	Query string `toml:"query"`
}

View is a named saved filter.

Jump to

Keyboard shortcuts

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