dotenv

package module
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 3 Imported by: 3

README

OpenMix 出品:https://openmix.org

Mix Dotenv

基于 GoDotEnv 开发的具有类型转换功能的环境配置库

Based on GoDotEnv library, with type conversion function

Usage

  • 安装
go get -u github.com/mix-go/dotenv
  • 使用
_ = dotenv.Load(".env")

i := dotenv.Getenv("key").String()
i := dotenv.Getenv("key").Bool()
i := dotenv.Getenv("key").Int64()
i := dotenv.Getenv("key").Float64()

i := dotenv.Getenv("key").String("default")
i := dotenv.Getenv("key").Bool(false)
i := dotenv.Getenv("key").Int64(123)
i := dotenv.Getenv("key").Float64(123.4)

License

Apache License Version 2.0, http://www.apache.org/licenses/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getenv

func Getenv(key string) *envValue

func Load

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

Load will read your env file(s) and load them into ENV for this process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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