Documentation ¶
Index ¶
- func NewHeroConfig(params ...interface{}) (interface{}, error)
- type HeroConfig
- func (conf *HeroConfig) Get(key string) interface{}
- func (conf *HeroConfig) GetBool(key string) bool
- func (conf *HeroConfig) GetFloat64(key string) float64
- func (conf *HeroConfig) GetInt(key string) int
- func (conf *HeroConfig) GetIntSlice(key string) []int
- func (conf *HeroConfig) GetString(key string) string
- func (conf *HeroConfig) GetStringMap(key string) map[string]interface{}
- func (conf *HeroConfig) GetStringMapString(key string) map[string]string
- func (conf *HeroConfig) GetStringMapStringSlice(key string) map[string][]string
- func (conf *HeroConfig) GetStringSlice(key string) []string
- func (conf *HeroConfig) GetTime(key string) time.Time
- func (conf *HeroConfig) IsExist(key string) bool
- func (conf *HeroConfig) Load(key string, val interface{}) error
- type HeroConfigProvider
- func (provider *HeroConfigProvider) Boot(c framework.Container) error
- func (provider *HeroConfigProvider) IsDefer() bool
- func (provider *HeroConfigProvider) Name() string
- func (provider *HeroConfigProvider) Params(c framework.Container) []interface{}
- func (provider *HeroConfigProvider) Register(c framework.Container) framework.NewInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHeroConfig ¶
func NewHeroConfig(params ...interface{}) (interface{}, error)
NewHeroConfig 初始化Config方法
Types ¶
type HeroConfig ¶
type HeroConfig struct {
// contains filtered or unexported fields
}
HeroConfig 表示hero框架的配置文件服务
func (*HeroConfig) GetFloat64 ¶
func (conf *HeroConfig) GetFloat64(key string) float64
GetFloat64 get float64
func (*HeroConfig) GetIntSlice ¶
func (conf *HeroConfig) GetIntSlice(key string) []int
GetIntSlice get int slice type
func (*HeroConfig) GetString ¶
func (conf *HeroConfig) GetString(key string) string
GetString get string typen
func (*HeroConfig) GetStringMap ¶
func (conf *HeroConfig) GetStringMap(key string) map[string]interface{}
GetStringMap get map which key is string, value is interface
func (*HeroConfig) GetStringMapString ¶
func (conf *HeroConfig) GetStringMapString(key string) map[string]string
GetStringMapString get map which key is string, value is string
func (*HeroConfig) GetStringMapStringSlice ¶
func (conf *HeroConfig) GetStringMapStringSlice(key string) map[string][]string
GetStringMapStringSlice get map which key is string, value is string slice
func (*HeroConfig) GetStringSlice ¶
func (conf *HeroConfig) GetStringSlice(key string) []string
GetStringSlice get string slice type
func (*HeroConfig) GetTime ¶
func (conf *HeroConfig) GetTime(key string) time.Time
GetTime get time type
func (*HeroConfig) IsExist ¶
func (conf *HeroConfig) IsExist(key string) bool
IsExist check setting is exist
func (*HeroConfig) Load ¶
func (conf *HeroConfig) Load(key string, val interface{}) error
Load a config to a struct, val should be an pointer
type HeroConfigProvider ¶
type HeroConfigProvider struct{}
func (*HeroConfigProvider) Boot ¶
func (provider *HeroConfigProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*HeroConfigProvider) IsDefer ¶
func (provider *HeroConfigProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*HeroConfigProvider) Name ¶
func (provider *HeroConfigProvider) Name() string
/ Name define the name for this service
func (*HeroConfigProvider) Params ¶
func (provider *HeroConfigProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*HeroConfigProvider) Register ¶
func (provider *HeroConfigProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance