Skip to content

tint/env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sourcegraph GoDoc Go Report Card License

Installation

go get github.com/tint/env

初始化

自动检测应用目录

env.Setup()

自定义启动目录

env.Setup("path/to/directory")

获取值

  env.Lookup(name string) (val string, exists bool)
  env.Exists(name string) bool
  env.Unknown(name string, value ...interface{}) interface{}
  env.String(name string, value ...string) string
  env.Bytes(name string, value ...[]byte) []byte
  env.Int(name string, value ...int) int
  env.Duration(name string, value ...time.Duration) time.Duration
  env.Bool(name string, value ...bool) bool
  env.Map(prefix string) map[string]string
  env.Where(filter func(name string, value string) bool) map[string]string
  env.Environ() []string