config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultAPIURL       = "http://localhost:39867"
	DefaultOutputFormat = "json"
)

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the default config file path

func Save

func Save(cfg *Config) error

Save writes the current configuration to disk

func SaveConfig

func SaveConfig(configPath string, cfg *Config) error

SaveConfig saves configuration to a specific file path

func UpdateConfig

func UpdateConfig(configPath string, update *Config) error

UpdateConfig updates specific fields in an existing config file

Types

type Config

type Config struct {
	APIURL       string `mapstructure:"api_url"`
	OutputFormat string `mapstructure:"output_format"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default values

func Load

func Load() (*Config, error)

Load reads configuration from ~/.beeper-api-cli/config.yaml

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads configuration from a specific file path

func LoadFromEnv

func LoadFromEnv() *Config

LoadFromEnv loads configuration from environment variables

func (*Config) Merge

func (c *Config) Merge(override *Config) *Config

Merge merges override config into base config (non-empty values from override take precedence)

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid

Jump to

Keyboard shortcuts

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