Documentation
¶
Overview ¶
Package dotenv provide load .env data to os ENV
Index ¶
- Variables
- func Bool(name string, defVal ...bool) (val bool)
- func ClearLoaded()
- func DontUpperEnvKey()
- func Get(name string, defVal ...string) (val string)
- func Int(name string, defVal ...int) (val int)
- func Load(dir string, filenames ...string) (err error)
- func LoadExistFiles(filePaths ...string) error
- func LoadExists(dir string, filenames ...string) error
- func LoadFiles(filePaths ...string) (err error)
- func LoadFromMap(kv map[string]string) (err error)
- func LoadMatched(dir string, patterns ...string) error
- func LoadedData() map[string]string
- func LoadedFiles() []string
- func Reset()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // UpperEnvKey change key to upper on set ENV UpperEnvKey = true // DefaultName default file name DefaultName = ".env" // OnlyLoadExists only load on file exists OnlyLoadExists bool )
Functions ¶
func Load ¶
Load parse dotenv file data to os ENV. default load ".env" file
- NEW: filename support simple glob pattern. eg: ".env.*", "*.env"
Usage:
dotenv.Load("./", ".env")
func LoadExistFiles ¶ added in v2.1.1
LoadExistFiles load ENV from given files, only load exists
func LoadExists ¶
LoadExists only load on file exists. see Load
func LoadFromMap ¶
LoadFromMap load data from given string map
func LoadMatched ¶ added in v2.3.0
LoadMatched load env files by match filename pattern. Default pattern is *.env
Usage:
dotenv.LoadMatched("./local")
dotenv.LoadMatched("./", "*.env")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.