conf

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigNotFoundErr = 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