configdir

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 7 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

Overview

Package configdir finds and loads a tool's directory of YAML configuration files, such as .sre or .localize.

Index

Constants

View Source
const FlagName = "config-dir"

FlagName is the persistent flag that overrides the configuration directory.

Variables

This section is empty.

Functions

func AddFlag

func AddFlag(cmd *cobra.Command, target *string, defaultDir string)

AddFlag registers --config-dir on cmd and accepts --configDir as an alias for it.

func Load

func Load(dir string, out any, foreignKeys ...string) error

Load decodes every *.yaml file in dir into out, in name order, so a later file overrides an earlier one. A key out does not declare, or a second YAML document in one file, fails with the file's path. Load skips an empty file and any file with one of foreignKeys at its top level, because another tool owns that file.

func Resolve

func Resolve(explicit, defaultDir string) (string, error)

Resolve returns explicit when it names a directory, or defaultDir when it exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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