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