Documentation ¶
Index ¶
- func NewFakeConfig(params ...interface{}) (interface{}, error)
- func NewGocoreConfig(params ...interface{}) (interface{}, error)
- type FakeConfig
- func (conf *FakeConfig) Get(key string) interface{}
- func (conf *FakeConfig) GetBool(key string) bool
- func (conf *FakeConfig) GetFloat64(key string) float64
- func (conf *FakeConfig) GetInt(key string) int
- func (conf *FakeConfig) GetIntSlice(key string) []int
- func (conf *FakeConfig) GetString(key string) string
- func (conf *FakeConfig) GetStringMap(key string) map[string]interface{}
- func (conf *FakeConfig) GetStringMapString(key string) map[string]string
- func (conf *FakeConfig) GetStringMapStringSlice(key string) map[string][]string
- func (conf *FakeConfig) GetStringSlice(key string) []string
- func (conf *FakeConfig) GetTime(key string) time.Time
- func (conf *FakeConfig) IsExist(key string) bool
- func (conf *FakeConfig) Load(key string, val interface{}) error
- type FakeConfigProvider
- func (provider *FakeConfigProvider) Boot(c framework.Container) error
- func (provider *FakeConfigProvider) IsDefer() bool
- func (provider *FakeConfigProvider) Name() string
- func (provider *FakeConfigProvider) Params(c framework.Container) []interface{}
- func (provider *FakeConfigProvider) Register(c framework.Container) framework.NewInstance
- type GocoreConfig
- func (conf *GocoreConfig) Get(key string) interface{}
- func (conf *GocoreConfig) GetBool(key string) bool
- func (conf *GocoreConfig) GetFloat64(key string) float64
- func (conf *GocoreConfig) GetInt(key string) int
- func (conf *GocoreConfig) GetIntSlice(key string) []int
- func (conf *GocoreConfig) GetString(key string) string
- func (conf *GocoreConfig) GetStringMap(key string) map[string]interface{}
- func (conf *GocoreConfig) GetStringMapString(key string) map[string]string
- func (conf *GocoreConfig) GetStringMapStringSlice(key string) map[string][]string
- func (conf *GocoreConfig) GetStringSlice(key string) []string
- func (conf *GocoreConfig) GetTime(key string) time.Time
- func (conf *GocoreConfig) IsExist(key string) bool
- func (conf *GocoreConfig) Load(key string, val interface{}) error
- type GocoreConfigProvider
- func (provider *GocoreConfigProvider) Boot(c framework.Container) error
- func (provider *GocoreConfigProvider) IsDefer() bool
- func (provider *GocoreConfigProvider) Name() string
- func (provider *GocoreConfigProvider) Params(c framework.Container) []interface{}
- func (provider *GocoreConfigProvider) Register(c framework.Container) framework.NewInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeConfig ¶
func NewFakeConfig(params ...interface{}) (interface{}, error)
func NewGocoreConfig ¶
func NewGocoreConfig(params ...interface{}) (interface{}, error)
Types ¶
type FakeConfig ¶
type FakeConfig struct {
// contains filtered or unexported fields
}
func (*FakeConfig) Get ¶
func (conf *FakeConfig) Get(key string) interface{}
func (*FakeConfig) GetBool ¶
func (conf *FakeConfig) GetBool(key string) bool
func (*FakeConfig) GetFloat64 ¶
func (conf *FakeConfig) GetFloat64(key string) float64
func (*FakeConfig) GetInt ¶
func (conf *FakeConfig) GetInt(key string) int
func (*FakeConfig) GetIntSlice ¶
func (conf *FakeConfig) GetIntSlice(key string) []int
func (*FakeConfig) GetString ¶
func (conf *FakeConfig) GetString(key string) string
func (*FakeConfig) GetStringMap ¶
func (conf *FakeConfig) GetStringMap(key string) map[string]interface{}
GetStringMap get map which key is string, value is interface
func (*FakeConfig) GetStringMapString ¶
func (conf *FakeConfig) GetStringMapString(key string) map[string]string
GetStringMapString get map which key is string, value is string
func (*FakeConfig) GetStringMapStringSlice ¶
func (conf *FakeConfig) GetStringMapStringSlice(key string) map[string][]string
GetStringMapStringSlice get map which key is string, value is string slice
func (*FakeConfig) GetStringSlice ¶
func (conf *FakeConfig) GetStringSlice(key string) []string
func (*FakeConfig) IsExist ¶
func (conf *FakeConfig) IsExist(key string) bool
func (*FakeConfig) Load ¶
func (conf *FakeConfig) Load(key string, val interface{}) error
type FakeConfigProvider ¶
func (*FakeConfigProvider) Boot ¶
func (provider *FakeConfigProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*FakeConfigProvider) IsDefer ¶
func (provider *FakeConfigProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*FakeConfigProvider) Name ¶
func (provider *FakeConfigProvider) Name() string
Name define the name for this service
func (*FakeConfigProvider) Params ¶
func (provider *FakeConfigProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*FakeConfigProvider) Register ¶
func (provider *FakeConfigProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance
type GocoreConfig ¶
type GocoreConfig struct {
// contains filtered or unexported fields
}
func (*GocoreConfig) GetBool ¶
func (conf *GocoreConfig) GetBool(key string) bool
GetBool 获取bool类型配置
func (*GocoreConfig) GetFloat64 ¶
func (conf *GocoreConfig) GetFloat64(key string) float64
GetFloat64 get float64
func (*GocoreConfig) GetIntSlice ¶
func (conf *GocoreConfig) GetIntSlice(key string) []int
GetIntSlice get int slice type
func (*GocoreConfig) GetString ¶
func (conf *GocoreConfig) GetString(key string) string
GetString get string type
func (*GocoreConfig) GetStringMap ¶
func (conf *GocoreConfig) GetStringMap(key string) map[string]interface{}
GetStringMap get map which key is string, value is interface
func (*GocoreConfig) GetStringMapString ¶
func (conf *GocoreConfig) GetStringMapString(key string) map[string]string
GetStringMapString get map which key is string, value is string
func (*GocoreConfig) GetStringMapStringSlice ¶
func (conf *GocoreConfig) GetStringMapStringSlice(key string) map[string][]string
GetStringMapStringSlice get map which key is string, value is string slice
func (*GocoreConfig) GetStringSlice ¶
func (conf *GocoreConfig) GetStringSlice(key string) []string
GetStringSlice get string slice type
func (*GocoreConfig) GetTime ¶
func (conf *GocoreConfig) GetTime(key string) time.Time
GetTime get time type
func (*GocoreConfig) IsExist ¶
func (conf *GocoreConfig) IsExist(key string) bool
IsExist check setting is exist
func (*GocoreConfig) Load ¶
func (conf *GocoreConfig) Load(key string, val interface{}) error
Load a config to a struct, val should be an pointer
type GocoreConfigProvider ¶
type GocoreConfigProvider struct{}
func (*GocoreConfigProvider) Boot ¶
func (provider *GocoreConfigProvider) Boot(c framework.Container) error
func (*GocoreConfigProvider) IsDefer ¶
func (provider *GocoreConfigProvider) IsDefer() bool
func (*GocoreConfigProvider) Name ¶
func (provider *GocoreConfigProvider) Name() string
func (*GocoreConfigProvider) Params ¶
func (provider *GocoreConfigProvider) Params(c framework.Container) []interface{}
func (*GocoreConfigProvider) Register ¶
func (provider *GocoreConfigProvider) Register(c framework.Container) framework.NewInstance