dotnev

package
v2.9.9 Latest Latest
Warning

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

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

Documentation

Overview

Package dotnev provide load .env data to os ENV

Deprecated: please use github.com/gookit/ini/v2/dotenv

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
)

UpperEnvKey ...

Functions

func Bool added in v2.7.1

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 don't 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