Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config applies settings from .acurl.yaml files and ACURL_* environment variables to command flags.

Precedence, highest first: command-line flags, environment variables, the config file, flag defaults.

Index

Constants

View Source
const FileName = ".acurl.yaml"

FileName is the per-project config file name.

Variables

This section is empty.

Functions

func Apply

func Apply(fs *pflag.FlagSet, c Config, getenv func(string) string) error

Apply sets every flag in fs that was not given on the command line from the environment or, failing that, from c. Unknown config keys are returned as an error so typos do not go unnoticed.

func EnvName

func EnvName(flag string) string

EnvName returns the environment variable for a flag: --cloak-threshold becomes ACURL_CLOAK_THRESHOLD.

func Find

func Find(explicit string) (string, error)

Find returns the config file to use: explicit if set, else ./.acurl.yaml, else <user config dir>/acurl/config.yaml. It returns "" when none exists.

func Unknown

func Unknown(c Config, known map[string]bool) []string

Unknown returns config keys that match no flag of any command.

Types

type Config

type Config map[string]any

Config maps flag names to values, e.g. {"timeout": "10s", "agents": ["GPTBot"]}.

func Load

func Load(path string) (Config, error)

Load reads a config file. An empty path returns an empty Config.

Jump to

Keyboard shortcuts

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