config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config centralizes runtime configuration rules so startup behavior stays predictable across local runs and installed binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveConfigFilePath

func ResolveConfigFilePath() string

ResolveConfigFilePath returns the canonical user config path used for persistent startup configuration.

func ResolveEnvFilePath

func ResolveEnvFilePath() string

ResolveEnvFilePath chooses a practical .env.local location for CLI use so installed binaries still behave predictably outside the repository root.

func SaveConfigFile

func SaveConfigFile(path string, cfg Config) error

SaveConfigFile persists startup configuration to the user config directory.

Types

type Config

type Config struct {
	GitHubToken    string `env:"GH_TOKEN"`
	AnytypeBaseURL string `env:"ANYTYPE_BASE_URL"`
}

Config hold configuration values used throughout the application.

func Load

func Load(envFile string, configFile string) (Config, error)

Load resolves config with process env taking precedence over YAML and dotenv values, so explicit shell settings always win.

func (Config) Validate

func (c Config) Validate() error

Validate fails fast on required values so startup errors are immediate and explicit instead of surfacing later in downstream clients.

Jump to

Keyboard shortcuts

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