config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns ~/.allegro/config.json.

func ResolveWithConfig

func ResolveWithConfig(flagVal int, envVal string, configVal int, defaultVal int) int

ResolveWithConfig implements the 4-tier precedence: flag > env > config > default. For int values: 0 means "not set" for flag and config tiers.

func WriteConfig

func WriteConfig(path string, c Config) error

WriteConfig writes config to the given path, creating parent dirs.

Types

type Config

type Config struct {
	StorePath     string `json:"store_path,omitempty"`
	Workers       int    `json:"workers,omitempty"`
	LinkStrategy  string `json:"link_strategy,omitempty"`
	NoProgress    bool   `json:"no_progress"`
	NoColor       bool   `json:"no_color"`
	ComposerPath  string `json:"composer_path,omitempty"`
	NoDev         bool   `json:"no_dev"`
	NoScripts     bool   `json:"no_scripts"`
	PruneStaleDay int    `json:"prune_stale_days,omitempty"`
}

Config represents ~/.allegro/config.json. Config represents ~/.allegro/config.json.

func ReadConfig

func ReadConfig(path string) (Config, error)

ReadConfig reads the config file. Returns zero-value Config if missing or malformed.

Jump to

Keyboard shortcuts

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