dotenv

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LINE = `` /* 419-byte string literal not displayed */

LINE is the regexp matching a single line

Variables

This section is empty.

Functions

func Add

func Add(envMap map[string]string, overload bool)

func Get

func Get(key string) string

func Load

func Load(filename string, overload bool) error

加载.env变量配置

func MustParseEnv

func MustParseEnv(data string) map[string]string

MustParseEnv works the same as Parse but panics on error

func ParseEnv

func ParseEnv(data string) (map[string]string, error)

ParseEnv reads a string in the .env format and returns a map of the extracted key=values. see https://github.com/bkeepers/dotenv

Types

type Env

type Env map[string]string

环境变量

func (Env) Add

func (e Env) Add(key, value string)

func (Env) Get

func (e Env) Get(key string) string

func (Env) GetBool

func (e Env) GetBool(key string) bool

func (Env) GetDefault

func (e Env) GetDefault(key, dflt string) string

func (Env) GetFloat

func (e Env) GetFloat(key string) float64

func (Env) GetInt

func (e Env) GetInt(key string) int

func (Env) GetInt32

func (e Env) GetInt32(key string) int32

func (Env) GetInt64

func (e Env) GetInt64(key string) int64

Jump to

Keyboard shortcuts

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