dotnev

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 load on file exists
	OnlyLoadExists bool
)

Functions

func Bool

func Bool(name string, defVal ...bool) (val bool)

Bool get a bool value by key

func ClearLoaded

func ClearLoaded()

ClearLoaded clear the previously set ENV value

func DontUpperEnvKey

func DontUpperEnvKey()

DontUpperEnvKey dont change key to upper on set ENV

func Get

func Get(name string, defVal ...string) (val string)

Get get os ENV value by name

func Int

func Int(name string, defVal ...int) (val int)

Int get a int value by key

func Load

func Load(dir string, filenames ...string) (err error)

Load parse .env file data to os ENV. Usage:

dotenv.Load("./", ".env")

func LoadExists

func LoadExists(dir string, filenames ...string) error

LoadExists only load on file exists

func LoadFromMap

func LoadFromMap(kv map[string]string) (err error)

LoadFromMap load data from given string map

func LoadedData

func LoadedData() map[string]string

LoadedData get all loaded data by dontenv

Types

This section is empty.

Jump to

Keyboard shortcuts

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