config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyAddSeparator          = "add.separator"
	KeyDefaultEditor         = "default.editor"
	KeyDefaultFilterGroup    = "default.filter.groups"
	KeyDefaultFilterTag      = "default.filter.tags"
	KeyDefaultReviewMode     = "default.review.mode"
	KeyDefaultReviewRenderer = "default.review.renderer"
	KeyDefaultReviewLimit    = "default.review.limit"
	KeyPathPluginsDir        = "path.plugins_dir"
	KeyPathPluginsLogs       = "path.plugins_logs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	V *viper.Viper
}

func InitConfig

func InitConfig() (*Config, error)

func (*Config) Remove

func (c *Config) Remove(ctx context.Context, key string) error

func (*Config) Resolve

func (c *Config) Resolve(key string, override string, systemFallback string) string

Resolve evaluates a hierarchical chain of values to find the active configuration setting. It prioritizes an explicit runtime override value (e.g., from a user's CLI flag). If that override is empty or set to "default", it pulls the value matching the specified key from the configuration file. If the file configuration is also missing, empty, or set to default, it returns the hardcoded system fallback string.

func (*Config) ResolveInt

func (c *Config) ResolveInt(key string, override int, systemFallback int) int

func (*Config) Set

func (c *Config) Set(ctx context.Context, key string, value string) error

Jump to

Keyboard shortcuts

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