conf

package
v0.32.55 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 8 Imported by: ? 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

This section is empty.

Variables

View Source
var ErrConfigNotFound = errors.New("cannot find configuration file")

Functions

This section is empty.

Types

type ConfigFileMapper

type ConfigFileMapper string

ConfigFileMapper is a kong.Mapper that resolves config files.

When applied to a CLI flag, it attempts to find a configuration file that best matches the specified name using the following rules:

  1. If the value is a full or relative path to an existing file, that file is chosen.
  2. If the value is a file name (without a path separator) with an extension (e.g. "config.yaml") and a file with that name exists in the config directory, that file is chosen.
  3. If the value is a string without an dot (e.g. "eng") and a file with that name (i.e. "eng.*") exists in the config directory, that file is chosen. If multiple files match, the first one is chosen and a warning is printed to stderr.

func (ConfigFileMapper) Decode

func (m ConfigFileMapper) Decode(ctx *kong.DecodeContext, target reflect.Value) error

Jump to

Keyboard shortcuts

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