Documentation ¶
Index ¶
- func NewWebgoEnv(params ...interface{}) (interface{}, error)
- func NewWebgoTestingEnv(params ...interface{}) (interface{}, error)
- type WebgoEnv
- type WebgoEnvProvider
- func (provider *WebgoEnvProvider) Boot(c framework.Container) error
- func (provider *WebgoEnvProvider) IsDefer() bool
- func (provider *WebgoEnvProvider) Name() string
- func (provider *WebgoEnvProvider) Params(c framework.Container) []interface{}
- func (provider *WebgoEnvProvider) Register(c framework.Container) framework.NewInstance
- type WebgoTestingEnv
- type WebgoTestingEnvProvider
- func (provider *WebgoTestingEnvProvider) Boot(c framework.Container) error
- func (provider *WebgoTestingEnvProvider) IsDefer() bool
- func (provider *WebgoTestingEnvProvider) Name() string
- func (provider *WebgoTestingEnvProvider) Params(c framework.Container) []interface{}
- func (provider *WebgoTestingEnvProvider) Register(c framework.Container) framework.NewInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWebgoEnv ¶
func NewWebgoEnv(params ...interface{}) (interface{}, error)
NewWebgoEnv 有一个参数,.env文件所在的目录 example: NewWebgoEnv("/envfolder/") 会读取文件: /envfolder/.env .env的文件格式 FOO_ENV=BAR
func NewWebgoTestingEnv ¶
func NewWebgoTestingEnv(params ...interface{}) (interface{}, error)
NewWebgoEnv 有一个参数,.env文件所在的目录 example: NewWebgoEnv("/envfolder/") 会读取文件: /envfolder/.env .env的文件格式 FOO_ENV=BAR
Types ¶
type WebgoEnv ¶
type WebgoEnv struct {
// contains filtered or unexported fields
}
WebgoEnv 是 Env 的具体实现
type WebgoEnvProvider ¶
type WebgoEnvProvider struct {
Folder string
}
func (*WebgoEnvProvider) Boot ¶
func (provider *WebgoEnvProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*WebgoEnvProvider) IsDefer ¶
func (provider *WebgoEnvProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*WebgoEnvProvider) Name ¶
func (provider *WebgoEnvProvider) Name() string
/ Name define the name for this service
func (*WebgoEnvProvider) Params ¶
func (provider *WebgoEnvProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*WebgoEnvProvider) Register ¶
func (provider *WebgoEnvProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance
type WebgoTestingEnv ¶
type WebgoTestingEnv struct {
// contains filtered or unexported fields
}
WebgoEnv 是 Env 的具体实现
func (*WebgoTestingEnv) All ¶
func (en *WebgoTestingEnv) All() map[string]string
All 获取所有的环境变量,.env和运行环境变量融合后结果
func (*WebgoTestingEnv) AppEnv ¶
func (en *WebgoTestingEnv) AppEnv() string
AppEnv 获取表示当前APP环境的变量APP_ENV
func (*WebgoTestingEnv) Get ¶
func (en *WebgoTestingEnv) Get(key string) string
Get 获取某个环境变量,如果没有设置,返回""
func (*WebgoTestingEnv) IsExist ¶
func (en *WebgoTestingEnv) IsExist(key string) bool
IsExist 判断一个环境变量是否有被设置
type WebgoTestingEnvProvider ¶
type WebgoTestingEnvProvider struct {
Folder string
}
func (*WebgoTestingEnvProvider) Boot ¶
func (provider *WebgoTestingEnvProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*WebgoTestingEnvProvider) IsDefer ¶
func (provider *WebgoTestingEnvProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*WebgoTestingEnvProvider) Name ¶
func (provider *WebgoTestingEnvProvider) Name() string
/ Name define the name for this service
func (*WebgoTestingEnvProvider) Params ¶
func (provider *WebgoTestingEnvProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*WebgoTestingEnvProvider) Register ¶
func (provider *WebgoTestingEnvProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance