env

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHadeEnv

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

NewHadeEnv有一个参数,.env文件所在的目录 example:NewHadeEnv("/envfolder/") 会读取文件:/envfolder/.env .env的文件形式 FOO——ENV=BAR

Types

type HadeEnv

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

HadeEnv是Env的具体实现

func (*HadeEnv) All

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

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

func (*HadeEnv) AppEnv

func (en *HadeEnv) AppEnv() string

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

func (*HadeEnv) Get

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

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

func (*HadeEnv) IsExist

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

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

type HadeEnvProvider

type HadeEnvProvider struct {
	Folder string
}

func (*HadeEnvProvider) Boot

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

func (*HadeEnvProvider) IsDefer

func (provider *HadeEnvProvider) IsDefer() bool

func (*HadeEnvProvider) Name

func (provider *HadeEnvProvider) Name() string

func (*HadeEnvProvider) Params

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

func (*HadeEnvProvider) Register

Jump to

Keyboard shortcuts

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