config

package
v2.7.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 11 Imported by: 1 module, 4 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

This section is empty.

Functions

func DecodeTOML

func DecodeTOML(r io.Reader, v any) error

DecodeTOML decodes toml from r in to v. Requires strict field matches and returns full toml.StrictMissingError details.

func NamedMultiErrorList

func NamedMultiErrorList(err error, name string) error

func Validate

func Validate(cfg interface{}) (err error)

Validate returns any errors from calling Validated.ValidateConfig on cfg and any nested types that implement Validated.

Types

type ErrDeprecated added in v2.7.0

type ErrDeprecated struct {
	Name    string
	Version semver.Version
}

func (ErrDeprecated) Error added in v2.7.0

func (e ErrDeprecated) Error() string

type ErrEmpty

type ErrEmpty = config.ErrEmpty

type ErrInvalid

type ErrInvalid = config.ErrInvalid

func NewErrDuplicate

func NewErrDuplicate(name string, value any) ErrInvalid

NewErrDuplicate returns an ErrInvalid with a standard duplicate message.

type ErrMissing

type ErrMissing = config.ErrMissing

type ErrOverride

type ErrOverride struct {
	Name string
}

func (ErrOverride) Error

func (e ErrOverride) Error() string

type UniqueStrings

type UniqueStrings = config.UniqueStrings

UniqueStrings is a helper for tracking unique values in string form.

type Validated

type Validated interface {
	// ValidateConfig returns nil if the config is valid, otherwise an error describing why it is invalid.
	//
	// For implementations:
	//  - Use package multierr to accumulate all errors, rather than returning the first encountered.
	//  - If an anonymous field also implements ValidateConfig(), it must be called explicitly!
	ValidateConfig() error
}

Validated configurations impose constraints that must be checked.

Jump to

Keyboard shortcuts

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