Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBackendImplementor(backend Backend)
- func RegisterCallbackImplementor(callback Callback)
- func RegisterImplementor(cfg Configure)
- type AddrParams
- type Address
- type Array
- func (t *Array) ArrayAt(i int) *embedArray
- func (t *Array) AtomicUpdate(v string)
- func (t *Array) Bools() []*embedBool
- func (t *Array) Changed(evt UpdateEvent)
- func (t *Array) Floats() []*embedFloat
- func (t *Array) Ints() []*embedInt
- func (t *Array) Len() int
- func (t *Array) String() string
- func (t *Array) Strings() []*embedString
- func (t *Array) Uints() []*embedUint
- type Backend
- type Bool
- type Callback
- type CallbackFunc
- type Configure
- type Dialect
- type DynamicType
- type EventChan
- type EventType
- type Float
- type Int
- type KVPair
- type KVPairs
- type Map
- func (t *Map) ArrayVal(key string) *embedArray
- func (t *Map) AtomicUpdate(v string)
- func (t *Map) BoolVal(key string) *embedBool
- func (t *Map) Changed(evt UpdateEvent)
- func (t *Map) FloatVal(key string) *embedFloat
- func (t *Map) HasKey(key string) bool
- func (t *Map) IntVal(key string) *embedInt
- func (t *Map) Keys() *embedArray
- func (t *Map) Len() int
- func (t *Map) MapVal(key string) *embedMap
- func (t *Map) String() string
- func (t *Map) StringVal(key string) *embedString
- func (t *Map) UintVal(key string) *embedUint
- type Option
- type Options
- type Schema
- type StaticType
- type String
- type Uint
- type UpdateEvent
- type WatchEvent
Constants ¶
View Source
const (
ExceedDeepLevel = "substratum: only support two level map/array"
)
Variables ¶
View Source
var EmptyOptions = func() *Options { return &Options{} }
Functions ¶
func RegisterBackendImplementor ¶ added in v2.0.2
func RegisterBackendImplementor(backend Backend)
RegisterBackendImplementor registers the configuration backend service implementor.
func RegisterCallbackImplementor ¶ added in v2.0.2
func RegisterCallbackImplementor(callback Callback)
RegisterCallbackImplementor registers the value updated callback service implementor.
func RegisterImplementor ¶
func RegisterImplementor(cfg Configure)
RegisterImplementor registers the configuration service implementor.
Types ¶
type AddrParams ¶
func (AddrParams) Encode ¶
func (m AddrParams) Encode(sep string) string
type Address ¶
type Array ¶ added in v2.0.2
type Array struct {
// contains filtered or unexported fields
}
func (*Array) AtomicUpdate ¶ added in v2.0.2
func (*Array) Changed ¶ added in v2.0.2
func (t *Array) Changed(evt UpdateEvent)
type Backend ¶ added in v2.0.2
type Backend interface { // Type returns the backend provider type. Type() string // Set value for the specified key. Set(key, value string) error // Get the value of the specified key or directory. Get(key string, dir bool) (*KVPairs, error) // Watch for changes of the specified key or directory. Watch(key string, version uint64, dir bool) (EventChan, error) // Close the provider connection. Close() }
Backend interface.
func BackendImplementor ¶ added in v2.0.2
func BackendImplementor() Backend
BackendImplementor returns the configuration backend service implementor.
type Bool ¶ added in v2.0.2
type Bool struct {
// contains filtered or unexported fields
}
func (*Bool) AtomicUpdate ¶ added in v2.0.2
func (*Bool) Changed ¶ added in v2.0.2
func (t *Bool) Changed(evt UpdateEvent)
type Callback ¶ added in v2.0.2
type Callback interface { RegChan() chan<- *CallbackFunc EvtChan() chan<- DynamicType }
func CallbackImplementor ¶ added in v2.0.2
func CallbackImplementor() Callback
CallbackImplementor returns the value updated callback service implementor.
type CallbackFunc ¶ added in v2.0.2
type CallbackFunc struct { Value DynamicType Event UpdateEvent }
type Configure ¶
type Configure interface { // Register the configuration pointer. Register(component string, v interface{}, opts ...Option) error }
func Implementor ¶
func Implementor() Configure
Implementor returns the configuration service implementor.
type DynamicType ¶ added in v2.0.2
type DynamicType interface { // AtomicUpdate updates value. AtomicUpdate(v string) // Changed will be invoked if value updated. Changed(evt UpdateEvent) }
DynamicType interface.
type EventChan ¶ added in v2.0.2
type EventChan chan *WatchEvent
type Float ¶ added in v2.0.2
type Float struct {
// contains filtered or unexported fields
}
func (*Float) AtomicUpdate ¶ added in v2.0.2
func (*Float) Changed ¶ added in v2.0.2
func (t *Float) Changed(evt UpdateEvent)
type Int ¶ added in v2.0.2
type Int struct {
// contains filtered or unexported fields
}
func (*Int) AtomicUpdate ¶ added in v2.0.2
func (*Int) Changed ¶ added in v2.0.2
func (t *Int) Changed(evt UpdateEvent)
type Map ¶ added in v2.0.2
type Map struct {
// contains filtered or unexported fields
}
func (*Map) AtomicUpdate ¶ added in v2.0.2
func (*Map) Changed ¶ added in v2.0.2
func (t *Map) Changed(evt UpdateEvent)
type Option ¶ added in v2.0.2
type Option func(options *Options)
func WithAutoCreation ¶ added in v2.0.2
type Schema ¶
type Schema string
const ( SQLite Schema = "sqlite" MySQL Schema = "mysql" PostgreSQL Schema = "postgres" SQLServer Schema = "sqlserver" Clickhouse Schema = "clickhouse" Redis Schema = "redis" RedisCluster Schema = "rediscluster" ElasticSearch6 Schema = "elasticsearch6" ElasticSearch7 Schema = "elasticsearch7" Kafka Schema = "kafka" Pulsar Schema = "pulsar" RocketMQ Schema = "rocketmq" )
type StaticType ¶ added in v2.0.2
type StaticType interface { // Set value. Set(v string) }
StaticType interface.
type String ¶ added in v2.0.2
type String struct {
// contains filtered or unexported fields
}
func (*String) AtomicUpdate ¶ added in v2.0.2
func (*String) Changed ¶ added in v2.0.2
func (t *String) Changed(evt UpdateEvent)
type Uint ¶ added in v2.0.2
type Uint struct {
// contains filtered or unexported fields
}
func (*Uint) AtomicUpdate ¶ added in v2.0.2
func (*Uint) Changed ¶ added in v2.0.2
func (t *Uint) Changed(evt UpdateEvent)
type UpdateEvent ¶ added in v2.0.2
type UpdateEvent func()
type WatchEvent ¶ added in v2.0.2
Click to show internal directories.
Click to hide internal directories.