Documentation ¶
Index ¶
- Constants
- func RegisterMonitor(dirverName string, newFunc NewMonitorFunc) (err error)
- func RegisterStorage(dirverName string, newFunc NewStorageFunc) (err error)
- type Field
- type KeyContentChangedCallback
- type Monitor
- type NewMonitorFunc
- type NewStorageFunc
- type OnValueChangedEvent
- type OnValueChangedSubscriber
- type OnWatchingError
- type Options
- type RedConf
- type RedisMonitor
- type RedisStorage
- type Storage
- type WatchingConfig
Constants ¶
View Source
const (
DefaultSubscribeChannel = "REDCONF:ONCHANGED"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterMonitor ¶
func RegisterMonitor(dirverName string, newFunc NewMonitorFunc) (err error)
func RegisterStorage ¶
func RegisterStorage(dirverName string, newFunc NewStorageFunc) (err error)
Types ¶
type KeyContentChangedCallback ¶
type KeyContentChangedCallback func(namespace, key string)
type Monitor ¶
type Monitor interface {
Watch(namespace string, callback KeyContentChangedCallback, onError OnWatchingError) (err error)
}
func CreateMonitor ¶
func NewRedisMonitor ¶
type NewMonitorFunc ¶
type NewStorageFunc ¶
type OnValueChangedEvent ¶
type OnValueChangedSubscriber ¶
type OnValueChangedSubscriber func(event OnValueChangedEvent)
type OnWatchingError ¶
type RedConf ¶
type RedConf struct {
// contains filtered or unexported fields
}
func (*RedConf) Subscribe ¶
func (p *RedConf) Subscribe(subscribers ...OnValueChangedSubscriber)
func (*RedConf) WatchWithConfig ¶
func (p *RedConf) WatchWithConfig(configs ...*WatchingConfig) (err error)
type RedisMonitor ¶
type RedisMonitor struct {
// contains filtered or unexported fields
}
func (*RedisMonitor) Watch ¶
func (p *RedisMonitor) Watch(namespace string, callback KeyContentChangedCallback, onError OnWatchingError) (err error)
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func (*RedisStorage) Get ¶
func (p *RedisStorage) Get(namespace, key string) (ret interface{}, err error)
func (*RedisStorage) Set ¶
func (p *RedisStorage) Set(namespace, key string, val interface{}) (err error)
type Storage ¶
type Storage interface { Set(namespace, key string, val interface{}) (err error) Get(namespace, key string) (ret interface{}, err error) }
func CreateStorage ¶
func NewRedisStorage ¶
type WatchingConfig ¶
type WatchingConfig struct {
// contains filtered or unexported fields
}
func NewWatchingConfig ¶
func NewWatchingConfig(v interface{}, name ...string) (wConf *WatchingConfig, err error)
func (*WatchingConfig) Fields ¶
func (p *WatchingConfig) Fields() []Field
func (*WatchingConfig) Name ¶
func (p *WatchingConfig) Name() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.