configloader

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(dst any, opts LoadOptions) error

Load the configuration from a file and from the environment. "dst" must be a pointer to a struct. Note: this method currently does not work correctly with properties of the struct that are pointers.

Types

type LoadOptions

type LoadOptions struct {
	// Optional path to a YAML (or JSON) file to load
	FilePath string
	// Optional prefix for env vars.
	EnvPrefix string
	// If true, values loaded from the config file which have a zero value (e.g. empty strings or number 0's) are ignored.
	IgnoreZeroValuesInConfig bool
}

LoadOptions contains options for the Load method.

Jump to

Keyboard shortcuts

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