config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func ConfigPath

func ConfigPath() string

func PromptInput

func PromptInput(reader *bufio.Reader, label, defaultVal string) string

PromptInput reads a line from stdin with an optional default value shown in brackets.

func Resolve

func Resolve(flagVal, envKey string, configVal string) string

Resolve returns the effective value for a setting using priority: CLI flag > env var > config profile

Types

type Config

type Config struct {
	CurrentProfile string             `yaml:"current-profile"`
	Profiles       map[string]Profile `yaml:"profiles"`
}

func Load

func Load() (*Config, error)

func (*Config) ActiveProfile

func (c *Config) ActiveProfile() Profile

func (*Config) Save

func (c *Config) Save() error

type Profile

type Profile struct {
	APIURL    string `yaml:"api-url"`
	APIKey    string `yaml:"api-key"`
	ProjectID string `yaml:"project-id,omitempty"`
}

Jump to

Keyboard shortcuts

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