Documentation ¶
Index ¶
- func NewHeroEnv(params ...interface{}) (interface{}, error)
- type HeroEnv
- type HeroEnvProvider
- func (provider *HeroEnvProvider) Boot(c framework.Container) error
- func (provider *HeroEnvProvider) IsDefer() bool
- func (provider *HeroEnvProvider) Name() string
- func (provider *HeroEnvProvider) Params(c framework.Container) []interface{}
- func (provider *HeroEnvProvider) Register(c framework.Container) framework.NewInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHeroEnv ¶
func NewHeroEnv(params ...interface{}) (interface{}, error)
NewHeroEnv 有一个参数,.env文件所在的目录 example: NewHeroEnv("/envfolder/") 会读取文件: /envfolder/.env .env的文件格式 FOO_ENV=BAR
Types ¶
type HeroEnv ¶
type HeroEnv struct {
// contains filtered or unexported fields
}
HeroEnv 是 Env 的具体实现
type HeroEnvProvider ¶
type HeroEnvProvider struct {
Folder string
}
func (*HeroEnvProvider) Boot ¶
func (provider *HeroEnvProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*HeroEnvProvider) IsDefer ¶
func (provider *HeroEnvProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*HeroEnvProvider) Name ¶
func (provider *HeroEnvProvider) Name() string
/ Name define the name for this service
func (*HeroEnvProvider) Params ¶
func (provider *HeroEnvProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*HeroEnvProvider) Register ¶
func (provider *HeroEnvProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance
Click to show internal directories.
Click to hide internal directories.