config

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 6 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 DefaultBaseURL = "https://api.bron.org"

Variables

This section is empty.

Functions

func Path

func Path() (string, error)

Types

type Config

type Config struct {
	ActiveProfile string             `yaml:"active_profile"`
	Profiles      map[string]Profile `yaml:"profiles"`
	// contains filtered or unexported fields
}

func Load

func Load() (*Config, error)

func (*Config) FilePath

func (c *Config) FilePath() string

FilePath returns the resolved on-disk location of this config.

func (*Config) Resolve

func (c *Config) Resolve(name string) (*Profile, error)

Resolve returns the profile to use, applying env overrides on top of YAML. Precedence (highest first): explicit name → BRON_PROFILE → ActiveProfile → "default". Env vars BRON_WORKSPACE_ID, BRON_BASE_URL, BRON_API_KEY_FILE override individual fields.

func (*Config) Save

func (c *Config) Save() error

Save writes the config back to disk, creating parent directories as needed. File mode is 0600 — it may contain workspace IDs and key-file paths.

type Profile

type Profile struct {
	Workspace string `yaml:"workspace,omitempty"`
	BaseURL   string `yaml:"base_url,omitempty"`
	KeyFile   string `yaml:"key_file,omitempty"`
	Proxy     string `yaml:"proxy,omitempty"`
}

Jump to

Keyboard shortcuts

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