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