config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 4 Imported by: 0

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