Documentation
¶
Index ¶
- func AllConfigOptionDeclareWithDefault() interface{}
- func AtomicAllConfigSet(update interface{})
- func AtomicConfigSet(update interface{})
- func AtomicRedisSet(update interface{})
- func AtomicSpecSet(update interface{})
- func AtomicXXXXXXSet(update interface{})
- func ConfigOptionDeclareWithDefault() interface{}
- func ETCDOptionDeclareWithDefault() interface{}
- func InstallAllConfigWatchDog(dog func(cc *AllConfig))
- func InstallCallbackOnAtomicAllConfigSet(callback func(cc AllConfigInterface) bool)
- func InstallCallbackOnAtomicConfigSet(callback func(cc ConfigInterface) bool)
- func InstallCallbackOnAtomicRedisSet(callback func(cc RedisInterface) bool)
- func InstallCallbackOnAtomicSpecSet(callback func(cc SpecInterface) bool)
- func InstallCallbackOnAtomicXXXXXXSet(callback func(cc XXXXXXInterface) bool)
- func InstallConfigWatchDog(dog func(cc *Config))
- func InstallETCDWatchDog(dog func(cc *ETCD))
- func InstallOnlyAppendWatchDog(dog func(cc *OnlyAppend))
- func InstallRedisWatchDog(dog func(cc *Redis))
- func InstallSpecWatchDog(dog func(cc *spec))
- func InstallXXXXXXWatchDog(dog func(cc *XXXXXX))
- func NewSpec(opts ...SpecOption) *spec
- func OnlyAppendOptionDeclareWithDefault() interface{}
- func RedisOptionDeclareWithDefault() interface{}
- func XXXXXXOptionDeclareWithDefault() interface{}
- type AllConfig
- func (cc *AllConfig) ApplyOption(opts ...AllConfigOption) []AllConfigOption
- func (cc *AllConfig) AtomicSetFunc() func(interface{})
- func (cc *AllConfig) GetETCD() *ETCD
- func (cc *AllConfig) GetRedis() RedisVisitor
- func (cc *AllConfig) GetTestInterface() interface{}
- func (cc *AllConfig) GetTypeBool() bool
- func (cc *AllConfig) GetTypeDuration() time.Duration
- func (cc *AllConfig) GetTypeFloat32() float32
- func (cc *AllConfig) GetTypeFloat64() float32
- func (cc *AllConfig) GetTypeInt() int
- func (cc *AllConfig) GetTypeInt16() int16
- func (cc *AllConfig) GetTypeInt32() int32
- func (cc *AllConfig) GetTypeInt64() int64
- func (cc *AllConfig) GetTypeInt8() int8
- func (cc *AllConfig) GetTypeMapIntInt() map[int]int
- func (cc *AllConfig) GetTypeMapIntString() map[int]string
- func (cc *AllConfig) GetTypeMapStringDuration() map[string]time.Duration
- func (cc *AllConfig) GetTypeMapStringInt() map[string]int
- func (cc *AllConfig) GetTypeMapStringIntNotLeaf() map[string]int
- func (cc *AllConfig) GetTypeMapStringString() map[string]string
- func (cc *AllConfig) GetTypeSliceDuratuon() []time.Duration
- func (cc *AllConfig) GetTypeSliceFloat32() []float32
- func (cc *AllConfig) GetTypeSliceFloat64() []float64
- func (cc *AllConfig) GetTypeSliceInt() []int
- func (cc *AllConfig) GetTypeSliceInt16() []int16
- func (cc *AllConfig) GetTypeSliceInt32() []int32
- func (cc *AllConfig) GetTypeSliceInt64() []int64
- func (cc *AllConfig) GetTypeSliceInt8() []int8
- func (cc *AllConfig) GetTypeSliceString() []string
- func (cc *AllConfig) GetTypeSliceUin16() []uint16
- func (cc *AllConfig) GetTypeSliceUint() []uint
- func (cc *AllConfig) GetTypeSliceUint32() []uint32
- func (cc *AllConfig) GetTypeSliceUint64() []uint64
- func (cc *AllConfig) GetTypeSliceUint8() []uint8
- func (cc *AllConfig) GetTypeString() string
- func (cc *AllConfig) GetTypeUint() int
- func (cc *AllConfig) GetTypeUint16() uint16
- func (cc *AllConfig) GetTypeUint32() uint32
- func (cc *AllConfig) GetTypeUint64() uint64
- func (cc *AllConfig) GetTypeUint8() uint8
- type AllConfigInterface
- type AllConfigOption
- type AllConfigOptionFunc
- func AppendTypeSliceDuratuon(v ...time.Duration) AllConfigOptionFunc
- func AppendTypeSliceFloat32(v ...float32) AllConfigOptionFunc
- func AppendTypeSliceFloat64(v ...float64) AllConfigOptionFunc
- func AppendTypeSliceInt(v ...int) AllConfigOptionFunc
- func AppendTypeSliceInt16(v ...int16) AllConfigOptionFunc
- func AppendTypeSliceInt32(v ...int32) AllConfigOptionFunc
- func AppendTypeSliceInt64(v ...int64) AllConfigOptionFunc
- func AppendTypeSliceInt8(v ...int8) AllConfigOptionFunc
- func AppendTypeSliceString(v ...string) AllConfigOptionFunc
- func AppendTypeSliceUin16(v ...uint16) AllConfigOptionFunc
- func AppendTypeSliceUint(v ...uint) AllConfigOptionFunc
- func AppendTypeSliceUint32(v ...uint32) AllConfigOptionFunc
- func AppendTypeSliceUint64(v ...uint64) AllConfigOptionFunc
- func AppendTypeSliceUint8(v ...uint8) AllConfigOptionFunc
- func WithETCD(v *ETCD) AllConfigOptionFunc
- func WithRedis(v *Redis) AllConfigOptionFunc
- func WithTestInterface(v interface{}) AllConfigOptionFunc
- func WithTypeBool(v bool) AllConfigOptionFunc
- func WithTypeDuration(v time.Duration) AllConfigOptionFunc
- func WithTypeFloat32(v float32) AllConfigOptionFunc
- func WithTypeFloat64(v float32) AllConfigOptionFunc
- func WithTypeInt(v int) AllConfigOptionFunc
- func WithTypeInt16(v int16) AllConfigOptionFunc
- func WithTypeInt32(v int32) AllConfigOptionFunc
- func WithTypeInt64(v int64) AllConfigOptionFunc
- func WithTypeInt8(v int8) AllConfigOptionFunc
- func WithTypeMapIntInt(v map[int]int) AllConfigOptionFunc
- func WithTypeMapIntString(v map[int]string) AllConfigOptionFunc
- func WithTypeMapStringDuration(v map[string]time.Duration) AllConfigOptionFunc
- func WithTypeMapStringInt(v map[string]int) AllConfigOptionFunc
- func WithTypeMapStringIntNotLeaf(v map[string]int) AllConfigOptionFunc
- func WithTypeMapStringString(v map[string]string) AllConfigOptionFunc
- func WithTypeSliceDuratuon(v ...time.Duration) AllConfigOptionFunc
- func WithTypeSliceFloat32(v ...float32) AllConfigOptionFunc
- func WithTypeSliceFloat64(v ...float64) AllConfigOptionFunc
- func WithTypeSliceInt(v ...int) AllConfigOptionFunc
- func WithTypeSliceInt16(v ...int16) AllConfigOptionFunc
- func WithTypeSliceInt32(v ...int32) AllConfigOptionFunc
- func WithTypeSliceInt64(v ...int64) AllConfigOptionFunc
- func WithTypeSliceInt8(v ...int8) AllConfigOptionFunc
- func WithTypeSliceString(v ...string) AllConfigOptionFunc
- func WithTypeSliceUin16(v ...uint16) AllConfigOptionFunc
- func WithTypeSliceUint(v ...uint) AllConfigOptionFunc
- func WithTypeSliceUint32(v ...uint32) AllConfigOptionFunc
- func WithTypeSliceUint64(v ...uint64) AllConfigOptionFunc
- func WithTypeSliceUint8(v ...uint8) AllConfigOptionFunc
- func WithTypeString(v string) AllConfigOptionFunc
- func WithTypeUint(v int) AllConfigOptionFunc
- func WithTypeUint16(v uint16) AllConfigOptionFunc
- func WithTypeUint32(v uint32) AllConfigOptionFunc
- func WithTypeUint64(v uint64) AllConfigOptionFunc
- func WithTypeUint8(v uint8) AllConfigOptionFunc
- type AllConfigVisitor
- type Config
- func (cc *Config) ApplyOption(opts ...ConfigOption) []ConfigOption
- func (cc *Config) AtomicSetFunc() func(interface{})
- func (cc *Config) GetFOO() *FOO
- func (cc *Config) GetFood() *string
- func (cc *Config) GetPaths() Paths
- func (cc *Config) GetSpecSub() SpecVisitor
- func (cc *Config) GetSubTest() *SubTest
- func (cc *Config) GetTestEmptyMap() map[int]int
- func (cc *Config) GetTestHTTPPort() string
- func (cc *Config) GetTestInt() int
- func (cc *Config) GetTestInt64() int64
- func (cc *Config) GetTestMapIntInt() map[int]int
- func (cc *Config) GetTestMapIntString() map[int]string
- func (cc *Config) GetTestMapStringInt() map[string]int
- func (cc *Config) GetTestMapStringString() map[string]string
- func (cc *Config) GetTestNil() interface{}
- func (cc *Config) GetTestNilFunc() func()
- func (cc *Config) GetTestParamterBool() bool
- func (cc *Config) GetTestParamterStr() string
- func (cc *Config) GetTestProtected() []byte
- func (cc *Config) GetTestSliceBool() []bool
- func (cc *Config) GetTestSliceByte() []byte
- func (cc *Config) GetTestSliceInt() []int
- func (cc *Config) GetTestSliceInt64() []int64
- func (cc *Config) GetTestSliceIntEmpty() []int
- func (cc *Config) GetTestSliceIntNil() []int
- func (cc *Config) GetTestSliceString() []string
- func (cc *Config) GetTestString() string
- func (cc *Config) GetWalk() func()
- type ConfigInterface
- type ConfigOption
- type ConfigOptionFunc
- func AppendTestSliceBool(v ...bool) ConfigOptionFunc
- func AppendTestSliceInt(v ...int) ConfigOptionFunc
- func AppendTestSliceInt64(v ...int64) ConfigOptionFunc
- func AppendTestSliceIntEmpty(v ...int) ConfigOptionFunc
- func AppendTestSliceIntNil(v ...int) ConfigOptionFunc
- func AppendTestSliceString(v ...string) ConfigOptionFunc
- func WithFOO(v *FOO) ConfigOptionFunc
- func WithFood(v *string) ConfigOptionFunc
- func WithPaths(v Paths) ConfigOptionFunc
- func WithSpecSub(v *spec) ConfigOptionFunc
- func WithSubTest(v *SubTest) ConfigOptionFunc
- func WithTTTTTTTT(v interface{}) ConfigOptionFunc
- func WithTestEmptyMap(v map[int]int) ConfigOptionFunc
- func WithTestHTTPPort(v string) ConfigOptionFunc
- func WithTestInt(v int) ConfigOptionFunc
- func WithTestInt64(v int64) ConfigOptionFunc
- func WithTestMapIntInt(v map[int]int) ConfigOptionFunc
- func WithTestMapIntString(v map[int]string) ConfigOptionFunc
- func WithTestMapStringInt(v map[string]int) ConfigOptionFunc
- func WithTestMapStringString(v map[string]string) ConfigOptionFunc
- func WithTestNilFunc(v func()) ConfigOptionFunc
- func WithTestSliceBool(v ...bool) ConfigOptionFunc
- func WithTestSliceByte(v []byte) ConfigOptionFunc
- func WithTestSliceInt(v ...int) ConfigOptionFunc
- func WithTestSliceInt64(v ...int64) ConfigOptionFunc
- func WithTestSliceIntEmpty(v ...int) ConfigOptionFunc
- func WithTestSliceIntNil(v ...int) ConfigOptionFunc
- func WithTestSliceString(v ...string) ConfigOptionFunc
- func WithTestString(v string) ConfigOptionFunc
- func WithWalk(v func()) ConfigOptionFunc
- type ConfigVisitor
- type ETCD
- type ETCDInterface
- type ETCDOption
- type ETCDOptionFunc
- type ETCDVisitor
- type FOO
- type OnlyAppend
- type OnlyAppendInterface
- type OnlyAppendOption
- type OnlyAppendOptionFunc
- type OnlyAppendVisitor
- type Paths
- type Redis
- type RedisInterface
- type RedisOption
- type RedisOptionFunc
- type RedisVisitor
- type SpecInterface
- type SpecOption
- type SpecOptionFunc
- type SpecVisitor
- type SubTest
- type Timeouts
- type WatchError
- type XXXXXX
- func (cc *XXXXXX) ApplyOption(opts ...XXXXXXOption) []XXXXXXOption
- func (cc *XXXXXX) AtomicSetFunc() func(interface{})
- func (cc *XXXXXX) GetEndpoints() []string
- func (cc *XXXXXX) GetMapRedis() map[string]*Redis
- func (cc *XXXXXX) GetOnWatchError() WatchError
- func (cc *XXXXXX) GetOnWatchErrorNotNil() func(loaderName string, confPath string, watchErr error)
- func (cc *XXXXXX) GetOptionUsage() string
- func (cc *XXXXXX) GetReadTimeout() time.Duration
- func (cc *XXXXXX) GetRedis() RedisVisitordeprecated
- func (cc *XXXXXX) GetTypeBool() bool
- func (cc *XXXXXX) GetTypeMapIntString() map[int]string
- func (cc *XXXXXX) GetTypeSliceDuratuon() []time.Duration
- func (cc *XXXXXX) GetTypeSliceInt64() []int64
- type XXXXXXInterface
- type XXXXXXOption
- type XXXXXXOptionFunc
- func AppendXXXXXXEndpoints(v ...string) XXXXXXOptionFunc
- func AppendXXXXXXTypeSliceDuratuon(v ...time.Duration) XXXXXXOptionFunc
- func AppendXXXXXXTypeSliceInt64(v ...int64) XXXXXXOptionFunc
- func WithXXXXXXEndpoints(v ...string) XXXXXXOptionFunc
- func WithXXXXXXMapRedis(v map[string]*Redis) XXXXXXOptionFunc
- func WithXXXXXXOnWatchError(v WatchError) XXXXXXOptionFunc
- func WithXXXXXXOnWatchErrorNotNil(v func(loaderName string, confPath string, watchErr error)) XXXXXXOptionFunc
- func WithXXXXXXOptionUsage(v string) XXXXXXOptionFunc
- func WithXXXXXXReadTimeout(v time.Duration) XXXXXXOptionFunc
- func WithXXXXXXRedis(v *Redis) XXXXXXOptionFuncdeprecated
- func WithXXXXXXTypeBool(v bool) XXXXXXOptionFunc
- func WithXXXXXXTypeMapIntString(v map[int]string) XXXXXXOptionFunc
- func WithXXXXXXTypeSliceDuratuon(v ...time.Duration) XXXXXXOptionFunc
- func WithXXXXXXTypeSliceInt64(v ...int64) XXXXXXOptionFunc
- type XXXXXXVisitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllConfigOptionDeclareWithDefault ¶ added in v1.0.2
func AllConfigOptionDeclareWithDefault() interface{}
func AtomicAllConfigSet ¶ added in v1.0.2
func AtomicAllConfigSet(update interface{})
AtomicAllConfigSet atomic setter for *AllConfig
func AtomicConfigSet ¶
func AtomicConfigSet(update interface{})
AtomicConfigSet atomic setter for *Config
func AtomicRedisSet ¶ added in v1.0.1
func AtomicRedisSet(update interface{})
AtomicRedisSet atomic setter for *Redis
func AtomicXXXXXXSet ¶ added in v1.0.3
func AtomicXXXXXXSet(update interface{})
AtomicXXXXXXSet atomic setter for *XXXXXX
func ConfigOptionDeclareWithDefault ¶
func ConfigOptionDeclareWithDefault() interface{}
func ETCDOptionDeclareWithDefault ¶ added in v1.0.2
func ETCDOptionDeclareWithDefault() interface{}
func InstallAllConfigWatchDog ¶ added in v1.0.2
func InstallAllConfigWatchDog(dog func(cc *AllConfig))
InstallAllConfigWatchDog the installed func will called when NewAllConfig called
func InstallCallbackOnAtomicAllConfigSet ¶ added in v1.0.2
func InstallCallbackOnAtomicAllConfigSet(callback func(cc AllConfigInterface) bool)
InstallCallbackOnAtomicAllConfigSet install callback
func InstallCallbackOnAtomicConfigSet ¶ added in v1.0.1
func InstallCallbackOnAtomicConfigSet(callback func(cc ConfigInterface) bool)
InstallCallbackOnAtomicConfigSet install callback
func InstallCallbackOnAtomicRedisSet ¶ added in v1.0.1
func InstallCallbackOnAtomicRedisSet(callback func(cc RedisInterface) bool)
InstallCallbackOnAtomicRedisSet install callback
func InstallCallbackOnAtomicSpecSet ¶ added in v1.0.1
func InstallCallbackOnAtomicSpecSet(callback func(cc SpecInterface) bool)
InstallCallbackOnAtomicSpecSet install callback
func InstallCallbackOnAtomicXXXXXXSet ¶ added in v1.0.3
func InstallCallbackOnAtomicXXXXXXSet(callback func(cc XXXXXXInterface) bool)
InstallCallbackOnAtomicXXXXXXSet install callback
func InstallConfigWatchDog ¶
func InstallConfigWatchDog(dog func(cc *Config))
InstallConfigWatchDog the installed func will called when NewFuncNameSpecified called
func InstallETCDWatchDog ¶ added in v1.0.2
func InstallETCDWatchDog(dog func(cc *ETCD))
InstallETCDWatchDog the installed func will called when NewETCD called
func InstallOnlyAppendWatchDog ¶ added in v1.0.9
func InstallOnlyAppendWatchDog(dog func(cc *OnlyAppend))
InstallOnlyAppendWatchDog the installed func will called when NewOnlyAppend called
func InstallRedisWatchDog ¶ added in v1.0.1
func InstallRedisWatchDog(dog func(cc *Redis))
InstallRedisWatchDog the installed func will called when NewRedis called
func InstallSpecWatchDog ¶
func InstallSpecWatchDog(dog func(cc *spec))
InstallSpecWatchDog the installed func will called when NewSpec called
func InstallXXXXXXWatchDog ¶ added in v1.0.2
func InstallXXXXXXWatchDog(dog func(cc *XXXXXX))
InstallXXXXXXWatchDog the installed func will called when NewXXXXXX called
func OnlyAppendOptionDeclareWithDefault ¶ added in v1.0.9
func OnlyAppendOptionDeclareWithDefault() interface{}
func RedisOptionDeclareWithDefault ¶ added in v1.0.1
func RedisOptionDeclareWithDefault() interface{}
func XXXXXXOptionDeclareWithDefault ¶ added in v1.0.2
func XXXXXXOptionDeclareWithDefault() interface{}
Types ¶
type AllConfig ¶ added in v1.0.2
type AllConfig struct { TypeBool bool `xconf:"type_bool"` TypeString string `xconf:"type_string"` TypeDuration time.Duration `xconf:"type_duration"` TypeFloat32 float32 `xconf:"type_float32"` TypeFloat64 float32 `xconf:"type_float64"` TypeInt int `xconf:"type_int"` TypeUint int `xconf:"type_uint"` TypeInt8 int8 `xconf:"type_int8"` TypeUint8 uint8 `xconf:"type_uint8"` TypeInt16 int16 `xconf:"type_int16"` TypeUint16 uint16 `xconf:"type_uint16"` TypeInt32 int32 `xconf:"type_int32"` TypeUint32 uint32 `xconf:"type_uint32"` TypeInt64 int64 `xconf:"type_int64"` TypeUint64 uint64 `xconf:"type_uint64"` TypeSliceInt []int `xconf:"type_slice_int"` TypeSliceUint []uint `xconf:"type_slice_uint"` TypeSliceInt8 []int8 `xconf:"type_slice_int8"` TypeSliceUint8 []uint8 `xconf:"type_slice_uint8"` TypeSliceInt16 []int16 `xconf:"type_slice_int16"` TypeSliceUin16 []uint16 `xconf:"type_slice_uin16"` TypeSliceInt32 []int32 `xconf:"type_slice_int32"` TypeSliceUint32 []uint32 `xconf:"type_slice_uint32"` TypeSliceInt64 []int64 `xconf:"type_slice_int64"` TypeSliceUint64 []uint64 `xconf:"type_slice_uint64"` TypeSliceString []string `xconf:"type_slice_string"` TypeSliceFloat32 []float32 `xconf:"type_slice_float32"` TypeSliceFloat64 []float64 `xconf:"type_slice_float64"` TypeSliceDuratuon []time.Duration `xconf:"type_slice_duratuon"` // annotation@TypeMapStringIntNotLeaf(xconf="type_map_string_int_not_leaf,notleaf") TypeMapStringIntNotLeaf map[string]int `xconf:"type_map_string_int_not_leaf,notleaf"` TypeMapStringInt map[string]int `xconf:"type_map_string_int"` TypeMapIntString map[int]string `xconf:"type_map_int_string"` TypeMapStringString map[string]string `xconf:"type_map_string_string"` TypeMapIntInt map[int]int `xconf:"type_map_int_int"` TypeMapStringDuration map[string]time.Duration `xconf:"type_map_string_duration"` // annotation@Redis(getter="RedisVisitor") Redis *Redis `xconf:"redis"` ETCD *ETCD `xconf:"etcd"` TestInterface interface{} `xconf:"test_interface"` }
AllConfig should use NewAllConfig to initialize it
func NewAllConfig ¶ added in v1.0.2
func NewAllConfig(opts ...AllConfigOption) *AllConfig
NewAllConfig new AllConfig
func (*AllConfig) ApplyOption ¶ added in v1.0.2
func (cc *AllConfig) ApplyOption(opts ...AllConfigOption) []AllConfigOption
ApplyOption apply multiple new option and return the old ones sample: old := cc.ApplyOption(WithTimeout(time.Second)) defer cc.ApplyOption(old...)
func (*AllConfig) AtomicSetFunc ¶ added in v1.0.2
func (cc *AllConfig) AtomicSetFunc() func(interface{})
AtomicSetFunc used for XConf
func (*AllConfig) GetRedis ¶ added in v1.0.2
func (cc *AllConfig) GetRedis() RedisVisitor
func (*AllConfig) GetTestInterface ¶ added in v1.0.2
func (cc *AllConfig) GetTestInterface() interface{}
func (*AllConfig) GetTypeBool ¶ added in v1.0.2
all getter func
func (*AllConfig) GetTypeDuration ¶ added in v1.0.2
func (*AllConfig) GetTypeFloat32 ¶ added in v1.0.2
func (*AllConfig) GetTypeFloat64 ¶ added in v1.0.2
func (*AllConfig) GetTypeInt ¶ added in v1.0.2
func (*AllConfig) GetTypeInt16 ¶ added in v1.0.2
func (*AllConfig) GetTypeInt32 ¶ added in v1.0.2
func (*AllConfig) GetTypeInt64 ¶ added in v1.0.2
func (*AllConfig) GetTypeInt8 ¶ added in v1.0.2
func (*AllConfig) GetTypeMapIntInt ¶ added in v1.0.2
func (*AllConfig) GetTypeMapIntString ¶ added in v1.0.2
func (*AllConfig) GetTypeMapStringDuration ¶ added in v1.0.2
func (*AllConfig) GetTypeMapStringInt ¶ added in v1.0.2
func (*AllConfig) GetTypeMapStringIntNotLeaf ¶ added in v1.0.2
func (*AllConfig) GetTypeMapStringString ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceDuratuon ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceFloat32 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceFloat64 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceInt ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceInt16 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceInt32 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceInt64 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceInt8 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceString ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceUin16 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceUint ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceUint32 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceUint64 ¶ added in v1.0.2
func (*AllConfig) GetTypeSliceUint8 ¶ added in v1.0.2
func (*AllConfig) GetTypeString ¶ added in v1.0.2
func (*AllConfig) GetTypeUint ¶ added in v1.0.2
func (*AllConfig) GetTypeUint16 ¶ added in v1.0.2
func (*AllConfig) GetTypeUint32 ¶ added in v1.0.2
func (*AllConfig) GetTypeUint64 ¶ added in v1.0.2
func (*AllConfig) GetTypeUint8 ¶ added in v1.0.2
type AllConfigInterface ¶ added in v1.0.2
type AllConfigInterface interface { AllConfigVisitor ApplyOption(...AllConfigOption) []AllConfigOption }
AllConfigInterface visitor + ApplyOption interface for AllConfig
type AllConfigOption ¶ added in v1.0.2
type AllConfigOption interface {
Apply(cc *AllConfig) AllConfigOption
}
AllConfigOptionFunc option func
type AllConfigOptionFunc ¶ added in v1.0.9
type AllConfigOptionFunc func(cc *AllConfig) AllConfigOptionFunc
func AppendTypeSliceDuratuon ¶ added in v1.0.9
func AppendTypeSliceDuratuon(v ...time.Duration) AllConfigOptionFunc
AppendTypeSliceDuratuon append func for filed TypeSliceDuratuon
func AppendTypeSliceFloat32 ¶ added in v1.0.9
func AppendTypeSliceFloat32(v ...float32) AllConfigOptionFunc
AppendTypeSliceFloat32 append func for filed TypeSliceFloat32
func AppendTypeSliceFloat64 ¶ added in v1.0.9
func AppendTypeSliceFloat64(v ...float64) AllConfigOptionFunc
AppendTypeSliceFloat64 append func for filed TypeSliceFloat64
func AppendTypeSliceInt ¶ added in v1.0.9
func AppendTypeSliceInt(v ...int) AllConfigOptionFunc
AppendTypeSliceInt append func for filed TypeSliceInt
func AppendTypeSliceInt16 ¶ added in v1.0.9
func AppendTypeSliceInt16(v ...int16) AllConfigOptionFunc
AppendTypeSliceInt16 append func for filed TypeSliceInt16
func AppendTypeSliceInt32 ¶ added in v1.0.9
func AppendTypeSliceInt32(v ...int32) AllConfigOptionFunc
AppendTypeSliceInt32 append func for filed TypeSliceInt32
func AppendTypeSliceInt64 ¶ added in v1.0.9
func AppendTypeSliceInt64(v ...int64) AllConfigOptionFunc
AppendTypeSliceInt64 append func for filed TypeSliceInt64
func AppendTypeSliceInt8 ¶ added in v1.0.9
func AppendTypeSliceInt8(v ...int8) AllConfigOptionFunc
AppendTypeSliceInt8 append func for filed TypeSliceInt8
func AppendTypeSliceString ¶ added in v1.0.9
func AppendTypeSliceString(v ...string) AllConfigOptionFunc
AppendTypeSliceString append func for filed TypeSliceString
func AppendTypeSliceUin16 ¶ added in v1.0.9
func AppendTypeSliceUin16(v ...uint16) AllConfigOptionFunc
AppendTypeSliceUin16 append func for filed TypeSliceUin16
func AppendTypeSliceUint ¶ added in v1.0.9
func AppendTypeSliceUint(v ...uint) AllConfigOptionFunc
AppendTypeSliceUint append func for filed TypeSliceUint
func AppendTypeSliceUint32 ¶ added in v1.0.9
func AppendTypeSliceUint32(v ...uint32) AllConfigOptionFunc
AppendTypeSliceUint32 append func for filed TypeSliceUint32
func AppendTypeSliceUint64 ¶ added in v1.0.9
func AppendTypeSliceUint64(v ...uint64) AllConfigOptionFunc
AppendTypeSliceUint64 append func for filed TypeSliceUint64
func AppendTypeSliceUint8 ¶ added in v1.0.9
func AppendTypeSliceUint8(v ...uint8) AllConfigOptionFunc
AppendTypeSliceUint8 append func for filed TypeSliceUint8
func WithETCD ¶ added in v1.0.2
func WithETCD(v *ETCD) AllConfigOptionFunc
WithETCD option func for filed ETCD
func WithRedis ¶ added in v1.0.2
func WithRedis(v *Redis) AllConfigOptionFunc
WithRedis option func for filed Redis
func WithTestInterface ¶ added in v1.0.2
func WithTestInterface(v interface{}) AllConfigOptionFunc
WithTestInterface option func for filed TestInterface
func WithTypeBool ¶ added in v1.0.2
func WithTypeBool(v bool) AllConfigOptionFunc
WithTypeBool option func for filed TypeBool
func WithTypeDuration ¶ added in v1.0.2
func WithTypeDuration(v time.Duration) AllConfigOptionFunc
WithTypeDuration option func for filed TypeDuration
func WithTypeFloat32 ¶ added in v1.0.2
func WithTypeFloat32(v float32) AllConfigOptionFunc
WithTypeFloat32 option func for filed TypeFloat32
func WithTypeFloat64 ¶ added in v1.0.2
func WithTypeFloat64(v float32) AllConfigOptionFunc
WithTypeFloat64 option func for filed TypeFloat64
func WithTypeInt ¶ added in v1.0.2
func WithTypeInt(v int) AllConfigOptionFunc
WithTypeInt option func for filed TypeInt
func WithTypeInt16 ¶ added in v1.0.2
func WithTypeInt16(v int16) AllConfigOptionFunc
WithTypeInt16 option func for filed TypeInt16
func WithTypeInt32 ¶ added in v1.0.2
func WithTypeInt32(v int32) AllConfigOptionFunc
WithTypeInt32 option func for filed TypeInt32
func WithTypeInt64 ¶ added in v1.0.2
func WithTypeInt64(v int64) AllConfigOptionFunc
WithTypeInt64 option func for filed TypeInt64
func WithTypeInt8 ¶ added in v1.0.2
func WithTypeInt8(v int8) AllConfigOptionFunc
WithTypeInt8 option func for filed TypeInt8
func WithTypeMapIntInt ¶ added in v1.0.2
func WithTypeMapIntInt(v map[int]int) AllConfigOptionFunc
WithTypeMapIntInt option func for filed TypeMapIntInt
func WithTypeMapIntString ¶ added in v1.0.2
func WithTypeMapIntString(v map[int]string) AllConfigOptionFunc
WithTypeMapIntString option func for filed TypeMapIntString
func WithTypeMapStringDuration ¶ added in v1.0.2
func WithTypeMapStringDuration(v map[string]time.Duration) AllConfigOptionFunc
WithTypeMapStringDuration option func for filed TypeMapStringDuration
func WithTypeMapStringInt ¶ added in v1.0.2
func WithTypeMapStringInt(v map[string]int) AllConfigOptionFunc
WithTypeMapStringInt option func for filed TypeMapStringInt
func WithTypeMapStringIntNotLeaf ¶ added in v1.0.2
func WithTypeMapStringIntNotLeaf(v map[string]int) AllConfigOptionFunc
WithTypeMapStringIntNotLeaf option func for filed TypeMapStringIntNotLeaf
func WithTypeMapStringString ¶ added in v1.0.2
func WithTypeMapStringString(v map[string]string) AllConfigOptionFunc
WithTypeMapStringString option func for filed TypeMapStringString
func WithTypeSliceDuratuon ¶ added in v1.0.2
func WithTypeSliceDuratuon(v ...time.Duration) AllConfigOptionFunc
WithTypeSliceDuratuon option func for filed TypeSliceDuratuon
func WithTypeSliceFloat32 ¶ added in v1.0.2
func WithTypeSliceFloat32(v ...float32) AllConfigOptionFunc
WithTypeSliceFloat32 option func for filed TypeSliceFloat32
func WithTypeSliceFloat64 ¶ added in v1.0.2
func WithTypeSliceFloat64(v ...float64) AllConfigOptionFunc
WithTypeSliceFloat64 option func for filed TypeSliceFloat64
func WithTypeSliceInt ¶ added in v1.0.2
func WithTypeSliceInt(v ...int) AllConfigOptionFunc
WithTypeSliceInt option func for filed TypeSliceInt
func WithTypeSliceInt16 ¶ added in v1.0.2
func WithTypeSliceInt16(v ...int16) AllConfigOptionFunc
WithTypeSliceInt16 option func for filed TypeSliceInt16
func WithTypeSliceInt32 ¶ added in v1.0.2
func WithTypeSliceInt32(v ...int32) AllConfigOptionFunc
WithTypeSliceInt32 option func for filed TypeSliceInt32
func WithTypeSliceInt64 ¶ added in v1.0.2
func WithTypeSliceInt64(v ...int64) AllConfigOptionFunc
WithTypeSliceInt64 option func for filed TypeSliceInt64
func WithTypeSliceInt8 ¶ added in v1.0.2
func WithTypeSliceInt8(v ...int8) AllConfigOptionFunc
WithTypeSliceInt8 option func for filed TypeSliceInt8
func WithTypeSliceString ¶ added in v1.0.2
func WithTypeSliceString(v ...string) AllConfigOptionFunc
WithTypeSliceString option func for filed TypeSliceString
func WithTypeSliceUin16 ¶ added in v1.0.2
func WithTypeSliceUin16(v ...uint16) AllConfigOptionFunc
WithTypeSliceUin16 option func for filed TypeSliceUin16
func WithTypeSliceUint ¶ added in v1.0.2
func WithTypeSliceUint(v ...uint) AllConfigOptionFunc
WithTypeSliceUint option func for filed TypeSliceUint
func WithTypeSliceUint32 ¶ added in v1.0.2
func WithTypeSliceUint32(v ...uint32) AllConfigOptionFunc
WithTypeSliceUint32 option func for filed TypeSliceUint32
func WithTypeSliceUint64 ¶ added in v1.0.2
func WithTypeSliceUint64(v ...uint64) AllConfigOptionFunc
WithTypeSliceUint64 option func for filed TypeSliceUint64
func WithTypeSliceUint8 ¶ added in v1.0.2
func WithTypeSliceUint8(v ...uint8) AllConfigOptionFunc
WithTypeSliceUint8 option func for filed TypeSliceUint8
func WithTypeString ¶ added in v1.0.2
func WithTypeString(v string) AllConfigOptionFunc
WithTypeString option func for filed TypeString
func WithTypeUint ¶ added in v1.0.2
func WithTypeUint(v int) AllConfigOptionFunc
WithTypeUint option func for filed TypeUint
func WithTypeUint16 ¶ added in v1.0.2
func WithTypeUint16(v uint16) AllConfigOptionFunc
WithTypeUint16 option func for filed TypeUint16
func WithTypeUint32 ¶ added in v1.0.2
func WithTypeUint32(v uint32) AllConfigOptionFunc
WithTypeUint32 option func for filed TypeUint32
func WithTypeUint64 ¶ added in v1.0.2
func WithTypeUint64(v uint64) AllConfigOptionFunc
WithTypeUint64 option func for filed TypeUint64
func WithTypeUint8 ¶ added in v1.0.2
func WithTypeUint8(v uint8) AllConfigOptionFunc
WithTypeUint8 option func for filed TypeUint8
func (AllConfigOptionFunc) Apply ¶ added in v1.0.9
func (f AllConfigOptionFunc) Apply(cc *AllConfig) AllConfigOption
type AllConfigVisitor ¶ added in v1.0.2
type AllConfigVisitor interface { GetTypeBool() bool GetTypeString() string GetTypeDuration() time.Duration GetTypeFloat32() float32 GetTypeFloat64() float32 GetTypeInt() int GetTypeUint() int GetTypeInt8() int8 GetTypeUint8() uint8 GetTypeInt16() int16 GetTypeUint16() uint16 GetTypeInt32() int32 GetTypeUint32() uint32 GetTypeInt64() int64 GetTypeUint64() uint64 GetTypeSliceInt() []int GetTypeSliceUint() []uint GetTypeSliceInt8() []int8 GetTypeSliceUint8() []uint8 GetTypeSliceInt16() []int16 GetTypeSliceUin16() []uint16 GetTypeSliceInt32() []int32 GetTypeSliceUint32() []uint32 GetTypeSliceInt64() []int64 GetTypeSliceUint64() []uint64 GetTypeSliceString() []string GetTypeSliceFloat32() []float32 GetTypeSliceFloat64() []float64 GetTypeSliceDuratuon() []time.Duration GetTypeMapStringIntNotLeaf() map[string]int GetTypeMapStringInt() map[string]int GetTypeMapIntString() map[int]string GetTypeMapStringString() map[string]string GetTypeMapIntInt() map[int]int GetTypeMapStringDuration() map[string]time.Duration GetRedis() RedisVisitor GetETCD() *ETCD GetTestInterface() interface{} }
AllConfigVisitor visitor interface for AllConfig
func AtomicAllConfig ¶ added in v1.0.2
func AtomicAllConfig() AllConfigVisitor
AtomicAllConfig return atomic *AllConfigVisitor
type Config ¶
type Config struct { TestMapIntInt map[int]int `xconf:"test_map_int_int"` SpecSub *spec `xconf:"spec_sub"` // annotation@SpecSub(getter="SpecVisitor") // test comment 1 // annotation@TestNil(option="WithTTTTTTTT") TestNil interface{} `xconf:"test_nil"` // test comment 3 TestSliceInt []int `xconf:"test_slice_int"` TestSliceInt64 []int64 `xconf:"test_slice_int64"` TestSliceString []string `xconf:"test_slice_string"` TestSliceBool []bool `xconf:"test_slice_bool"` TestSliceIntNil []int `xconf:"test_slice_int_nil"` TestSliceByte []byte `xconf:"test_slice_byte"` TestSliceIntEmpty []int `xconf:"test_slice_int_empty"` TestHTTPPort string `xconf:"test_http_port"` TestEmptyMap map[int]int `xconf:"test_empty_map"` TestInt64 int64 `xconf:"test_int64"` TestInt int `xconf:"test_int" usage:"这里是函数注释1,\"test\" , 这里是函数注释2"` TestMapIntString map[int]string `xconf:"test_map_int_string"` TestMapStringString map[string]string `xconf:"test_map_string_string"` TestString string `xconf:"test_string"` Food *string `xconf:"food"` Walk func() `xconf:"walk"` TestNilFunc func() `xconf:"test_nil_func"` // 中文1 SubTest *SubTest `xconf:"sub_test"` TestMapStringInt map[string]int `xconf:"test_map_string_int"` // annotation@TestProtected(private="true") TestProtected []byte `xconf:"test_protected"` // annotation@fOO(inline="true") *FOO `xconf:"f_oo"` // annotation@Paths(inline="true") Paths `xconf:"paths"` // annotation@TestParamterBool(arg=1) TestParamterBool bool `xconf:"test_paramter_bool"` // reserved parameter 1 // annotation@TestParamterStr(arg=22) TestParamterStr string `xconf:"test_paramter_str"` // reserved parameter 2 }
Config should use NewFuncNameSpecified to initialize it
func (*Config) ApplyOption ¶
func (cc *Config) ApplyOption(opts ...ConfigOption) []ConfigOption
ApplyOption apply multiple new option and return the old ones sample: old := cc.ApplyOption(WithTimeout(time.Second)) defer cc.ApplyOption(old...)
func (*Config) AtomicSetFunc ¶
func (cc *Config) AtomicSetFunc() func(interface{})
AtomicSetFunc used for XConf
func (*Config) GetSpecSub ¶
func (cc *Config) GetSpecSub() SpecVisitor
func (*Config) GetSubTest ¶
func (*Config) GetTestEmptyMap ¶
func (*Config) GetTestHTTPPort ¶
func (*Config) GetTestInt ¶
func (*Config) GetTestInt64 ¶
func (*Config) GetTestMapIntString ¶
func (*Config) GetTestMapStringInt ¶
func (*Config) GetTestMapStringString ¶
func (*Config) GetTestNil ¶
func (cc *Config) GetTestNil() interface{}
func (*Config) GetTestNilFunc ¶
func (cc *Config) GetTestNilFunc() func()
func (*Config) GetTestParamterBool ¶
func (*Config) GetTestParamterStr ¶
func (*Config) GetTestProtected ¶
func (*Config) GetTestSliceBool ¶
func (*Config) GetTestSliceByte ¶
func (*Config) GetTestSliceInt ¶
func (*Config) GetTestSliceInt64 ¶
func (*Config) GetTestSliceIntEmpty ¶
func (*Config) GetTestSliceIntNil ¶
func (*Config) GetTestSliceString ¶
func (*Config) GetTestString ¶
type ConfigInterface ¶
type ConfigInterface interface { ConfigVisitor ApplyOption(...ConfigOption) []ConfigOption }
ConfigInterface visitor + ApplyOption interface for Config
func NewFuncNameSpecified ¶
func NewFuncNameSpecified(testParamterBool bool, testParamterStr string, opts ...ConfigOption) ConfigInterface
NewFuncNameSpecified new Config
type ConfigOption ¶
type ConfigOption interface {
Apply(cc *Config) ConfigOption
}
ConfigOptionFunc option func
type ConfigOptionFunc ¶ added in v1.0.9
type ConfigOptionFunc func(cc *Config) ConfigOptionFunc
func AppendTestSliceBool ¶ added in v1.0.9
func AppendTestSliceBool(v ...bool) ConfigOptionFunc
AppendTestSliceBool append func for filed TestSliceBool
func AppendTestSliceInt ¶ added in v1.0.9
func AppendTestSliceInt(v ...int) ConfigOptionFunc
AppendTestSliceInt append func for filed TestSliceInt
func AppendTestSliceInt64 ¶ added in v1.0.9
func AppendTestSliceInt64(v ...int64) ConfigOptionFunc
AppendTestSliceInt64 append func for filed TestSliceInt64
func AppendTestSliceIntEmpty ¶ added in v1.0.9
func AppendTestSliceIntEmpty(v ...int) ConfigOptionFunc
AppendTestSliceIntEmpty append func for filed TestSliceIntEmpty
func AppendTestSliceIntNil ¶ added in v1.0.9
func AppendTestSliceIntNil(v ...int) ConfigOptionFunc
AppendTestSliceIntNil append func for filed TestSliceIntNil
func AppendTestSliceString ¶ added in v1.0.9
func AppendTestSliceString(v ...string) ConfigOptionFunc
AppendTestSliceString append func for filed TestSliceString
func WithPaths ¶ added in v1.0.4
func WithPaths(v Paths) ConfigOptionFunc
WithPaths option func for filed Paths
func WithSpecSub ¶
func WithSpecSub(v *spec) ConfigOptionFunc
WithSpecSub option func for filed SpecSub
func WithSubTest ¶
func WithSubTest(v *SubTest) ConfigOptionFunc
WithSubTest option func for filed SubTest
func WithTTTTTTTT ¶
func WithTTTTTTTT(v interface{}) ConfigOptionFunc
WithTTTTTTTT option func for filed TestNil
func WithTestEmptyMap ¶
func WithTestEmptyMap(v map[int]int) ConfigOptionFunc
WithTestEmptyMap option func for filed TestEmptyMap
func WithTestHTTPPort ¶
func WithTestHTTPPort(v string) ConfigOptionFunc
WithTestHTTPPort option func for filed TestHTTPPort
func WithTestInt64 ¶
func WithTestInt64(v int64) ConfigOptionFunc
WithTestInt64 option func for filed TestInt64
func WithTestMapIntInt ¶
func WithTestMapIntInt(v map[int]int) ConfigOptionFunc
WithTestMapIntInt option func for filed TestMapIntInt
func WithTestMapIntString ¶
func WithTestMapIntString(v map[int]string) ConfigOptionFunc
WithTestMapIntString option func for filed TestMapIntString
func WithTestMapStringInt ¶
func WithTestMapStringInt(v map[string]int) ConfigOptionFunc
WithTestMapStringInt option func for filed TestMapStringInt
func WithTestMapStringString ¶
func WithTestMapStringString(v map[string]string) ConfigOptionFunc
WithTestMapStringString option func for filed TestMapStringString
func WithTestNilFunc ¶
func WithTestNilFunc(v func()) ConfigOptionFunc
WithTestNilFunc option func for filed TestNilFunc
func WithTestSliceBool ¶
func WithTestSliceBool(v ...bool) ConfigOptionFunc
WithTestSliceBool option func for filed TestSliceBool
func WithTestSliceByte ¶
func WithTestSliceByte(v []byte) ConfigOptionFunc
WithTestSliceByte option func for filed TestSliceByte
func WithTestSliceInt ¶
func WithTestSliceInt(v ...int) ConfigOptionFunc
WithTestSliceInt option func for filed TestSliceInt
func WithTestSliceInt64 ¶
func WithTestSliceInt64(v ...int64) ConfigOptionFunc
WithTestSliceInt64 option func for filed TestSliceInt64
func WithTestSliceIntEmpty ¶
func WithTestSliceIntEmpty(v ...int) ConfigOptionFunc
WithTestSliceIntEmpty option func for filed TestSliceIntEmpty
func WithTestSliceIntNil ¶
func WithTestSliceIntNil(v ...int) ConfigOptionFunc
WithTestSliceIntNil option func for filed TestSliceIntNil
func WithTestSliceString ¶
func WithTestSliceString(v ...string) ConfigOptionFunc
WithTestSliceString option func for filed TestSliceString
func WithTestString ¶
func WithTestString(v string) ConfigOptionFunc
WithTestString option func for filed TestString
func (ConfigOptionFunc) Apply ¶ added in v1.0.9
func (f ConfigOptionFunc) Apply(cc *Config) ConfigOption
type ConfigVisitor ¶
type ConfigVisitor interface { GetTestMapIntInt() map[int]int GetSpecSub() SpecVisitor GetTestNil() interface{} GetTestSliceInt() []int GetTestSliceInt64() []int64 GetTestSliceString() []string GetTestSliceBool() []bool GetTestSliceIntNil() []int GetTestSliceByte() []byte GetTestSliceIntEmpty() []int GetTestHTTPPort() string GetTestEmptyMap() map[int]int GetTestInt64() int64 GetTestInt() int GetTestMapIntString() map[int]string GetTestMapStringString() map[string]string GetTestString() string GetFood() *string GetWalk() func() GetTestNilFunc() func() GetSubTest() *SubTest GetTestMapStringInt() map[string]int GetTestProtected() []byte GetFOO() *FOO GetPaths() Paths GetTestParamterBool() bool GetTestParamterStr() string }
ConfigVisitor visitor interface for Config
type ETCD ¶ added in v1.0.2
type ETCD struct { // annotation@Endpoints(comment="etcd地址") Endpoints []string `usage:"etcd地址"` // annotation@TimeoutsPointer(comment="timeout设置") TimeoutsPointer *Timeouts `usage:"timeout设置"` // annotation@Redis(getter="RedisVisitor") Redis *Redis // contains filtered or unexported fields }
ETCD should use NewETCD to initialize it
func NewETCD ¶ added in v1.0.2
func NewETCD(writeTimeout time.Duration, opts ...ETCDOption) *ETCD
NewETCD new ETCD
func (*ETCD) ApplyOption ¶ added in v1.0.2
func (cc *ETCD) ApplyOption(opts ...ETCDOption)
ApplyOption apply multiple new option
func (*ETCD) GetRedis ¶ added in v1.0.2
func (cc *ETCD) GetRedis() RedisVisitor
func (*ETCD) GetTimeoutsPointer ¶ added in v1.0.2
func (*ETCD) GetWriteTimeout ¶ added in v1.0.2
type ETCDInterface ¶ added in v1.0.2
type ETCDInterface interface { ETCDVisitor ApplyOption(...ETCDOption) }
ETCDInterface visitor + ApplyOption interface for ETCD
type ETCDOption ¶ added in v1.0.2
type ETCDOption interface {
Apply(cc *ETCD)
}
ETCDOptionFunc option func
type ETCDOptionFunc ¶ added in v1.0.9
type ETCDOptionFunc func(cc *ETCD)
func AppendETCDEndpoints ¶ added in v1.0.9
func AppendETCDEndpoints(v ...string) ETCDOptionFunc
AppendETCDEndpoints etcd地址
func WithETCDEndpoints ¶ added in v1.0.2
func WithETCDEndpoints(v ...string) ETCDOptionFunc
WithETCDEndpoints etcd地址
func WithETCDRedis ¶ added in v1.0.2
func WithETCDRedis(v *Redis) ETCDOptionFunc
WithETCDRedis option func for filed Redis
func WithETCDTimeoutsPointer ¶ added in v1.0.2
func WithETCDTimeoutsPointer(v *Timeouts) ETCDOptionFunc
WithETCDTimeoutsPointer timeout设置
func (ETCDOptionFunc) Apply ¶ added in v1.0.9
func (f ETCDOptionFunc) Apply(cc *ETCD)
type ETCDVisitor ¶ added in v1.0.2
type ETCDVisitor interface { GetEndpoints() []string GetTimeoutsPointer() *Timeouts GetRedis() RedisVisitor GetWriteTimeout() time.Duration }
ETCDVisitor visitor interface for ETCD
type OnlyAppend ¶ added in v1.0.9
type OnlyAppend struct {
Address []string
}
OnlyAppend should use NewOnlyAppend to initialize it
func NewOnlyAppend ¶ added in v1.0.9
func NewOnlyAppend(opts ...OnlyAppendOption) *OnlyAppend
NewOnlyAppend new OnlyAppend
func (*OnlyAppend) ApplyOption ¶ added in v1.0.9
func (cc *OnlyAppend) ApplyOption(opts ...OnlyAppendOption) []OnlyAppendOption
ApplyOption apply multiple new option and return the old ones sample: old := cc.ApplyOption(WithTimeout(time.Second)) defer cc.ApplyOption(old...)
func (*OnlyAppend) GetAddress ¶ added in v1.0.9
func (cc *OnlyAppend) GetAddress() []string
all getter func
type OnlyAppendInterface ¶ added in v1.0.9
type OnlyAppendInterface interface { OnlyAppendVisitor ApplyOption(...OnlyAppendOption) []OnlyAppendOption }
OnlyAppendInterface visitor + ApplyOption interface for OnlyAppend
type OnlyAppendOption ¶ added in v1.0.9
type OnlyAppendOption interface {
Apply(cc *OnlyAppend) OnlyAppendOption
}
OnlyAppendOptionFunc option func
type OnlyAppendOptionFunc ¶ added in v1.0.9
type OnlyAppendOptionFunc func(cc *OnlyAppend) OnlyAppendOptionFunc
func AppendAddress ¶ added in v1.0.9
func AppendAddress(v ...string) OnlyAppendOptionFunc
AppendAddress append func for filed Address
func WithAddress ¶ added in v1.0.9
func WithAddress(v ...string) OnlyAppendOptionFunc
WithAddress option func for filed Address
func (OnlyAppendOptionFunc) Apply ¶ added in v1.0.9
func (f OnlyAppendOptionFunc) Apply(cc *OnlyAppend) OnlyAppendOption
type OnlyAppendVisitor ¶ added in v1.0.9
type OnlyAppendVisitor interface {
GetAddress() []string
}
OnlyAppendVisitor visitor interface for OnlyAppend
type Redis ¶ added in v1.0.1
type Redis struct { Endpoints []string `xconf:"endpoints"` // annotation@Address(slice_only_append="true") Address []string `xconf:"address"` Cluster bool `xconf:"cluster"` TimeoutsStruct Timeouts `xconf:"timeouts_struct"` }
Redis should use NewRedis to initialize it
func (*Redis) ApplyOption ¶ added in v1.0.1
func (cc *Redis) ApplyOption(opts ...RedisOption) []RedisOption
ApplyOption apply multiple new option and return the old ones sample: old := cc.ApplyOption(WithTimeout(time.Second)) defer cc.ApplyOption(old...)
func (*Redis) AtomicSetFunc ¶ added in v1.0.1
func (cc *Redis) AtomicSetFunc() func(interface{})
AtomicSetFunc used for XConf
func (*Redis) GetAddress ¶ added in v1.0.9
func (*Redis) GetCluster ¶ added in v1.0.2
func (*Redis) GetEndpoints ¶ added in v1.0.2
all getter func
func (*Redis) GetTimeoutsStruct ¶ added in v1.0.2
type RedisInterface ¶ added in v1.0.1
type RedisInterface interface { RedisVisitor ApplyOption(...RedisOption) []RedisOption }
RedisInterface visitor + ApplyOption interface for Redis
type RedisOption ¶ added in v1.0.1
type RedisOption interface {
Apply(cc *Redis) RedisOption
}
RedisOptionFunc option func
type RedisOptionFunc ¶ added in v1.0.9
type RedisOptionFunc func(cc *Redis) RedisOptionFunc
func AppendRedisAddress ¶ added in v1.0.9
func AppendRedisAddress(v ...string) RedisOptionFunc
AppendRedisAddress append func for filed Address
func AppendRedisEndpoints ¶ added in v1.0.9
func AppendRedisEndpoints(v ...string) RedisOptionFunc
AppendRedisEndpoints append func for filed Endpoints
func WithRedisCluster ¶ added in v1.0.2
func WithRedisCluster(v bool) RedisOptionFunc
WithRedisCluster option func for filed Cluster
func WithRedisEndpoints ¶ added in v1.0.2
func WithRedisEndpoints(v ...string) RedisOptionFunc
WithRedisEndpoints option func for filed Endpoints
func WithRedisTimeoutsStruct ¶ added in v1.0.2
func WithRedisTimeoutsStruct(v Timeouts) RedisOptionFunc
WithRedisTimeoutsStruct option func for filed TimeoutsStruct
func (RedisOptionFunc) Apply ¶ added in v1.0.9
func (f RedisOptionFunc) Apply(cc *Redis) RedisOption
type RedisVisitor ¶ added in v1.0.1
type RedisVisitor interface { GetEndpoints() []string GetAddress() []string GetCluster() bool GetTimeoutsStruct() Timeouts }
RedisVisitor visitor interface for Redis
func AtomicRedis ¶ added in v1.0.1
func AtomicRedis() RedisVisitor
AtomicRedis return atomic *RedisVisitor
type SpecInterface ¶
type SpecInterface interface { SpecVisitor ApplyOption(...SpecOption) }
SpecInterface visitor + ApplyOption interface for spec
type SpecOptionFunc ¶ added in v1.0.9
type SpecOptionFunc func(cc *spec)
func WithServerTestBool1 ¶
func WithServerTestBool1(v bool) SpecOptionFunc
WithServerTestBool1 option func for filed TestBool1
func WithServerTestInt1 ¶
func WithServerTestInt1(v int) SpecOptionFunc
WithServerTestInt1 这里是函数注释3,这里是函数注释4
func WithServerTestNilFunc1 ¶
func WithServerTestNilFunc1(v func()) SpecOptionFunc
WithServerTestNilFunc1 option func for filed TestNilFunc1
func WithServerTestReserved2Inner1 ¶
func WithServerTestReserved2Inner1(v int) SpecOptionFunc
WithServerTestReserved2Inner1 option func for filed TestReserved2Inner1
func (SpecOptionFunc) Apply ¶ added in v1.0.9
func (f SpecOptionFunc) Apply(cc *spec)
type SpecVisitor ¶
type SpecVisitor interface { GetTestNil1() interface{} GetTestBool1() bool GetTestInt1() int GetTestNilFunc1() func() GetTestReserved2_() []byte GetTestReserved2Inner1() int }
SpecVisitor visitor interface for spec
type WatchError ¶ added in v1.0.2
type XXXXXX ¶ added in v1.0.2
type XXXXXX struct { OptionUsage string `xconf:"option_usage"` Endpoints []string `xconf:"endpoints"` ReadTimeout time.Duration `xconf:"read_timeout"` TypeMapIntString map[int]string `xconf:"type_map_int_string"` TypeSliceInt64 []int64 `xconf:"type_slice_int64"` TypeBool bool `xconf:"type_bool"` MapRedis map[string]*Redis `xconf:"map_redis"` // annotation@Redis(getter="RedisVisitor",deprecated="use MapRedis intead") Redis *Redis `xconf:"redis,deprecated" usage:"Deprecated: use MapRedis intead"` // 辅助指定类型为*Redis OnWatchError WatchError `xconf:"on_watch_error"` // 辅助指定类型为WatchError OnWatchErrorNotNil func(loaderName string, confPath string, watchErr error) `xconf:"on_watch_error_not_nil"` TypeSliceDuratuon []time.Duration `xconf:"type_slice_duratuon"` // 辅助指定类型为WatchError }
XXXXXX should use NewXXXXXX to initialize it
func (*XXXXXX) ApplyOption ¶ added in v1.0.2
func (cc *XXXXXX) ApplyOption(opts ...XXXXXXOption) []XXXXXXOption
ApplyOption apply multiple new option and return the old ones sample: old := cc.ApplyOption(WithTimeout(time.Second)) defer cc.ApplyOption(old...)
func (*XXXXXX) AtomicSetFunc ¶ added in v1.0.3
func (cc *XXXXXX) AtomicSetFunc() func(interface{})
AtomicSetFunc used for XConf
func (*XXXXXX) GetEndpoints ¶ added in v1.0.2
func (*XXXXXX) GetMapRedis ¶ added in v1.0.2
func (*XXXXXX) GetOnWatchError ¶ added in v1.0.2
func (cc *XXXXXX) GetOnWatchError() WatchError
func (*XXXXXX) GetOnWatchErrorNotNil ¶ added in v1.0.2
func (*XXXXXX) GetOptionUsage ¶ added in v1.0.3
all getter func
func (*XXXXXX) GetReadTimeout ¶ added in v1.0.2
func (*XXXXXX) GetRedis
deprecated
added in
v1.0.2
func (cc *XXXXXX) GetRedis() RedisVisitor
GetRedis visitor func for filed Redis
Deprecated: use MapRedis intead
func (*XXXXXX) GetTypeBool ¶ added in v1.0.2
func (*XXXXXX) GetTypeMapIntString ¶ added in v1.0.2
func (*XXXXXX) GetTypeSliceDuratuon ¶ added in v1.0.2
func (*XXXXXX) GetTypeSliceInt64 ¶ added in v1.0.2
type XXXXXXInterface ¶ added in v1.0.2
type XXXXXXInterface interface { XXXXXXVisitor ApplyOption(...XXXXXXOption) []XXXXXXOption }
XXXXXXInterface visitor + ApplyOption interface for XXXXXX
type XXXXXXOption ¶ added in v1.0.2
type XXXXXXOption interface {
Apply(cc *XXXXXX) XXXXXXOption
}
XXXXXXOptionFunc option func
type XXXXXXOptionFunc ¶ added in v1.0.9
type XXXXXXOptionFunc func(cc *XXXXXX) XXXXXXOptionFunc
func AppendXXXXXXEndpoints ¶ added in v1.0.9
func AppendXXXXXXEndpoints(v ...string) XXXXXXOptionFunc
AppendXXXXXXEndpoints append func for filed Endpoints
func AppendXXXXXXTypeSliceDuratuon ¶ added in v1.0.9
func AppendXXXXXXTypeSliceDuratuon(v ...time.Duration) XXXXXXOptionFunc
AppendXXXXXXTypeSliceDuratuon append func for filed TypeSliceDuratuon
func AppendXXXXXXTypeSliceInt64 ¶ added in v1.0.9
func AppendXXXXXXTypeSliceInt64(v ...int64) XXXXXXOptionFunc
AppendXXXXXXTypeSliceInt64 append func for filed TypeSliceInt64
func WithXXXXXXEndpoints ¶ added in v1.0.2
func WithXXXXXXEndpoints(v ...string) XXXXXXOptionFunc
WithXXXXXXEndpoints option func for filed Endpoints
func WithXXXXXXMapRedis ¶ added in v1.0.2
func WithXXXXXXMapRedis(v map[string]*Redis) XXXXXXOptionFunc
WithXXXXXXMapRedis option func for filed MapRedis
func WithXXXXXXOnWatchError ¶ added in v1.0.2
func WithXXXXXXOnWatchError(v WatchError) XXXXXXOptionFunc
WithXXXXXXOnWatchError option func for filed OnWatchError
func WithXXXXXXOnWatchErrorNotNil ¶ added in v1.0.2
func WithXXXXXXOnWatchErrorNotNil(v func(loaderName string, confPath string, watchErr error)) XXXXXXOptionFunc
WithXXXXXXOnWatchErrorNotNil option func for filed OnWatchErrorNotNil
func WithXXXXXXOptionUsage ¶ added in v1.0.3
func WithXXXXXXOptionUsage(v string) XXXXXXOptionFunc
WithXXXXXXOptionUsage option func for filed OptionUsage
func WithXXXXXXReadTimeout ¶ added in v1.0.2
func WithXXXXXXReadTimeout(v time.Duration) XXXXXXOptionFunc
WithXXXXXXReadTimeout option func for filed ReadTimeout
func WithXXXXXXRedis
deprecated
added in
v1.0.2
func WithXXXXXXRedis(v *Redis) XXXXXXOptionFunc
WithXXXXXXRedis option func for filed Redis
Deprecated: use MapRedis intead
func WithXXXXXXTypeBool ¶ added in v1.0.2
func WithXXXXXXTypeBool(v bool) XXXXXXOptionFunc
WithXXXXXXTypeBool option func for filed TypeBool
func WithXXXXXXTypeMapIntString ¶ added in v1.0.2
func WithXXXXXXTypeMapIntString(v map[int]string) XXXXXXOptionFunc
WithXXXXXXTypeMapIntString option func for filed TypeMapIntString
func WithXXXXXXTypeSliceDuratuon ¶ added in v1.0.2
func WithXXXXXXTypeSliceDuratuon(v ...time.Duration) XXXXXXOptionFunc
WithXXXXXXTypeSliceDuratuon option func for filed TypeSliceDuratuon
func WithXXXXXXTypeSliceInt64 ¶ added in v1.0.2
func WithXXXXXXTypeSliceInt64(v ...int64) XXXXXXOptionFunc
WithXXXXXXTypeSliceInt64 option func for filed TypeSliceInt64
func (XXXXXXOptionFunc) Apply ¶ added in v1.0.9
func (f XXXXXXOptionFunc) Apply(cc *XXXXXX) XXXXXXOption
type XXXXXXVisitor ¶ added in v1.0.2
type XXXXXXVisitor interface { GetOptionUsage() string GetEndpoints() []string GetReadTimeout() time.Duration GetTypeMapIntString() map[int]string GetTypeSliceInt64() []int64 GetTypeBool() bool GetMapRedis() map[string]*Redis // GetRedis visitor func for filed Redis // // Deprecated: use MapRedis intead GetRedis() RedisVisitor GetOnWatchError() WatchError GetOnWatchErrorNotNil() func(loaderName string, confPath string, watchErr error) GetTypeSliceDuratuon() []time.Duration }
XXXXXXVisitor visitor interface for XXXXXX
func AtomicXXXXXX ¶ added in v1.0.3
func AtomicXXXXXX() XXXXXXVisitor
AtomicXXXXXX return atomic *XXXXXXVisitor