env

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCoreEnv

func NewCoreEnv(params ...interface{}) (interface{}, error)

NewCoreEnv 有一个参数,.env文件所在的目录 example: NewCoreEnv("/envfolder/") 会读取文件: /envfolder/.env .env的文件格式 FOO_ENV=BAR

Types

type GocoreEnv

type GocoreEnv struct {
	// contains filtered or unexported fields
}

func (*GocoreEnv) All

func (en *GocoreEnv) All() map[string]string

All 获取所有的环境变量,.env和运行环境变量融合后

func (*GocoreEnv) AppEnv

func (en *GocoreEnv) AppEnv() string

AppEnv 获取表示当前APP环境的变量APP_ENV

func (*GocoreEnv) Get

func (en *GocoreEnv) Get(key string) string

Get 获取某个环境变量,如果没有设置,返回""

func (*GocoreEnv) IsExist

func (en *GocoreEnv) IsExist(key string) bool

IsExist 判断一个环境变量是否有被设置

type GocoreEnvProvider

type GocoreEnvProvider struct {
	Folder string
}

func (*GocoreEnvProvider) Boot

func (provider *GocoreEnvProvider) Boot(c framework.Container) error

func (*GocoreEnvProvider) IsDefer

func (provider *GocoreEnvProvider) IsDefer() bool

func (*GocoreEnvProvider) Name

func (provider *GocoreEnvProvider) Name() string

func (*GocoreEnvProvider) Params

func (provider *GocoreEnvProvider) Params(c framework.Container) []interface{}

func (*GocoreEnvProvider) Register

Jump to

Keyboard shortcuts

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