go-micro: github.com/micro/go-micro/config/source/env Index | Files

package env

import "github.com/micro/go-micro/config/source/env"

Index

Package Files

env.go options.go watcher.go

Variables

var (
    DefaultPrefixes = []string{}
)

func NewSource Uses

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 Uses

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 Uses

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.

Package env imports 7 packages (graph) and is imported by 4 packages. Updated 2020-02-08. Refresh now. Tools for package owners.