dotenv

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of this Provider
	Name = "dotenv"

	// FilesEnvVar is the environment variable which lists the files to load
	FilesEnvVar = "DOTENV_FILES"
)

Variables

View Source
var EnvVars = map[string]string{
	"DOTENV_FILES": `if DOTENV_FILES is set, will iterate over each file, parse and inject into Environ. If DOTENV_FILES is
not set, will look for any .env files in CWD.
e.g. DOTENV_FILES=/path/to/file1:/path/to/file2:...`,
}

EnvVars is a map of known vonfiguration environment variables and their usage descriptions

Functions

func New

func New() (environ.Provider, error)

New returns a new Parser as an environ.Provider or an error if configuring failed if no files are listed, will search in CWD for any .env files.

Types

type Parser

type Parser struct {
	Files []string `env:"DOTENV_FILES" envSeparator:":"`
}

Parser is an github.com/lumoslabs/vestibule/pkg/environ.Provider which accepts a list of dotenv files and, using github.com/joho/godotenv, parses them and adds the result to an environ.Environ object

func (*Parser) AddToEnviron

func (p *Parser) AddToEnviron(e *environ.Environ) error

AddToEnviron uses godotenv to read all specified dotenv files and add them to the environ.Environ without overwriting

Jump to

Keyboard shortcuts

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