config

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRepo

func AddRepo(repo string) error

func CLICommands added in v0.7.5

func CLICommands() map[string]blit.CLICommand

CLICommands returns auto-generated CLI commands for config fields.

func Editor added in v0.7.5

func Editor() *blit.ConfigEditor

Editor returns a blit.ConfigEditor auto-generated from struct tags.

func RemoveRepo

func RemoveRepo(repo string) error

func Save

func Save(cfg *Config) error

Save persists the current config value.

Types

type Config

type Config struct {
	RepoEntries []RepoEntry `yaml:"repos" blit:"label=Repos,group=Config,hint=Watched repos (owner/repo format)"`
	Interval    int         `yaml:"interval" blit:"label=Interval (sec),group=Polling,hint=Poll frequency (min 5),default=30,min=5"`
	Theme       string      `yaml:"theme,omitempty" blit:"label=Theme,group=Appearance,hint=Theme name (use ctrl+t to pick),readonly=true"`
}

Config holds the application configuration. blit struct tags enable auto-generated ConfigEditor and CLI commands.

func Load

func Load() (*Config, error)

Load loads the config using blit.Config[T] with struct tag defaults.

func (*Config) ExplicitPaths added in v0.2.0

func (c *Config) ExplicitPaths() map[string]string

ExplicitPaths returns a map of remote -> local path for repos with explicit paths.

func (*Config) Repos

func (c *Config) Repos() []string

Repos returns just the repo name strings for backward compatibility.

type RepoEntry added in v0.2.0

type RepoEntry struct {
	Name string `yaml:"name"`
	Path string `yaml:"path,omitempty"`
}

RepoEntry represents a watched repo with an optional local path override.

func (RepoEntry) MarshalYAML added in v0.2.0

func (r RepoEntry) MarshalYAML() (interface{}, error)

MarshalYAML writes as a plain string if no path is set.

func (*RepoEntry) UnmarshalYAML added in v0.2.0

func (r *RepoEntry) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML supports both string and object formats:

repos:
  - owner/repo
  - name: owner/repo
    path: /home/user/projects/repo

Jump to

Keyboard shortcuts

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