Documentation ¶
Index ¶
- func NewJadeConfig(params ...interface{}) (interface{}, error)
- type JadeConfig
- func (conf *JadeConfig) Get(key string) interface{}
- func (conf *JadeConfig) GetBool(key string) bool
- func (conf *JadeConfig) GetFloat64(key string) float64
- func (conf *JadeConfig) GetInt(key string) int
- func (conf *JadeConfig) GetIntSlice(key string) []int
- func (conf *JadeConfig) GetString(key string) string
- func (conf *JadeConfig) GetStringMap(key string) map[string]interface{}
- func (conf *JadeConfig) GetStringMapString(key string) map[string]string
- func (conf *JadeConfig) GetStringMapStringSlice(key string) map[string][]string
- func (conf *JadeConfig) GetStringSlice(key string) []string
- func (conf *JadeConfig) GetTime(key string) time.Time
- func (conf *JadeConfig) IsExist(key string) bool
- func (conf *JadeConfig) Load(key string, val interface{}) error
- type JadeConfigProvider
- func (provider *JadeConfigProvider) Boot(c framework.Container) error
- func (provider *JadeConfigProvider) IsDefer() bool
- func (provider *JadeConfigProvider) Name() string
- func (provider *JadeConfigProvider) Params(c framework.Container) []interface{}
- func (provider *JadeConfigProvider) Register(c framework.Container) framework.NewInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJadeConfig ¶
func NewJadeConfig(params ...interface{}) (interface{}, error)
NewJadeConfig 初始化Config方法
Types ¶
type JadeConfig ¶
func (*JadeConfig) Get ¶
func (conf *JadeConfig) Get(key string) interface{}
func (*JadeConfig) GetBool ¶
func (conf *JadeConfig) GetBool(key string) bool
func (*JadeConfig) GetFloat64 ¶
func (conf *JadeConfig) GetFloat64(key string) float64
GetFloat64 get float64
func (*JadeConfig) GetInt ¶
func (conf *JadeConfig) GetInt(key string) int
func (*JadeConfig) GetIntSlice ¶
func (conf *JadeConfig) GetIntSlice(key string) []int
GetIntSlice get int slice type
func (*JadeConfig) GetString ¶
func (conf *JadeConfig) GetString(key string) string
GetString get string typen
func (*JadeConfig) GetStringMap ¶
func (conf *JadeConfig) GetStringMap(key string) map[string]interface{}
GetStringMap get map which key is string, value is interface
func (*JadeConfig) GetStringMapString ¶
func (conf *JadeConfig) GetStringMapString(key string) map[string]string
GetStringMapString get map which key is string, value is string
func (*JadeConfig) GetStringMapStringSlice ¶
func (conf *JadeConfig) GetStringMapStringSlice(key string) map[string][]string
GetStringMapStringSlice get map which key is string, value is string slice
func (*JadeConfig) GetStringSlice ¶
func (conf *JadeConfig) GetStringSlice(key string) []string
GetStringSlice get string slice type
func (*JadeConfig) GetTime ¶
func (conf *JadeConfig) GetTime(key string) time.Time
GetTime get time type
func (*JadeConfig) IsExist ¶
func (conf *JadeConfig) IsExist(key string) bool
func (*JadeConfig) Load ¶
func (conf *JadeConfig) Load(key string, val interface{}) error
type JadeConfigProvider ¶
type JadeConfigProvider struct {
framework.ServiceProvider
}
func (*JadeConfigProvider) Boot ¶
func (provider *JadeConfigProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*JadeConfigProvider) IsDefer ¶
func (provider *JadeConfigProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*JadeConfigProvider) Name ¶
func (provider *JadeConfigProvider) Name() string
Name 代表了这个服务提供者的凭证
func (*JadeConfigProvider) Params ¶
func (provider *JadeConfigProvider) Params(c framework.Container) []interface{}
Params params 定义传递给 NewInstance 的参数,可以自定义多个,建议将 container 作为第一个参数
func (*JadeConfigProvider) Register ¶
func (provider *JadeConfigProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for mak a service instance
Click to show internal directories.
Click to hide internal directories.