dotenv

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 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 GetBool added in v1.0.2

func GetBool(key string) bool

func GetFloat added in v1.0.2

func GetFloat(key string) float64

func GetInt added in v1.0.2

func GetInt(key string) int

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) Get

func (e Env) Get(key string) string

func (Env) GetBool

func (e Env) GetBool(key string) bool

func (Env) GetFloat

func (e Env) GetFloat(key string) float64

func (Env) GetInt

func (e Env) GetInt(key string) int

Jump to

Keyboard shortcuts

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