env

package
v0.0.0-...-382bf78 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPrefixes = []string{}
)

Functions

func NewSource

func NewSource(opts ...source.Option) source.Source

NewSource returns a config source for parsing ENV variables. Underscores are delimiters for nesting, and all keys are lowercased.

Example:

"DATABASE_SERVER_HOST=localhost" will convert to

{
    "database": {
        "server": {
            "host": "localhost"
        }
    }
}

func WithPrefix

func WithPrefix(p ...string) source.Option

WithPrefix sets the environment variable prefixes to scope to. These prefixes will not be removed. Each prefix will be considered a top level config entry.

func WithStrippedPrefix

func WithStrippedPrefix(p ...string) source.Option

WithStrippedPrefix sets the environment variable prefixes to scope to. These prefixes will be removed from the actual config entries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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