Documentation ¶
Index ¶
- type EtcdFileWatcher
- type EtcdUdsWatcher
- type GeneralWatcher
- func (gw *GeneralWatcher) GetTimerCache() *cache.TimerCacheEtcd
- func (gw *GeneralWatcher) Init(tc *cache.TimerCacheEtcd, prefix string, callback func(k, v string))
- func (gw *GeneralWatcher) KeepEyesOnKey(key string)
- func (gw *GeneralWatcher) KeepEyesOnKeyWithPrefix(module string)
- func (gw *GeneralWatcher) Watch(tc *cache.TimerCacheEtcd, key string, putCallback func(k, v string), ...)
- type MemoryWatcher
- type SyncFileWorker
- type UnixSocket
- type Watcher
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdFileWatcher ¶
type EtcdFileWatcher struct { RetrySeconds int StoreDir string GeneralWatcher Tc *cache.TimerCacheEtcd }
EtcdFileWatcher : file storage watcher for etcd
func (*EtcdFileWatcher) Find ¶ added in v0.0.3
func (ecw *EtcdFileWatcher) Find(cmd []string) (string, error)
func (*EtcdFileWatcher) KeepEyesOnKey ¶
func (ecw *EtcdFileWatcher) KeepEyesOnKey(key string)
KeepEyesOnKey : Watching specific key
func (*EtcdFileWatcher) KeepEyesOnKeyWithPrefix ¶
func (ecw *EtcdFileWatcher) KeepEyesOnKeyWithPrefix(module string)
KeepEyesOnKeyWithPrefix : Watching specific prefix
func (*EtcdFileWatcher) SaveLocal ¶ added in v0.0.8
func (ecw *EtcdFileWatcher) SaveLocal(k, v string)
type EtcdUdsWatcher ¶
type EtcdUdsWatcher struct { GeneralWatcher Tc *cache.TimerCacheEtcd // contains filtered or unexported fields }
EtcdUdsWatcher : Unix domain socket watcher for etcd
func (*EtcdUdsWatcher) KeepEyesOnKey ¶
func (euw *EtcdUdsWatcher) KeepEyesOnKey(key string)
KeepEyesOnKey : Watching specific key
func (*EtcdUdsWatcher) KeepEyesOnKeyWithPrefix ¶
func (euw *EtcdUdsWatcher) KeepEyesOnKeyWithPrefix(prefix string)
KeepEyesOnKeyWithPrefix : Watch etcd with prefix
func (*EtcdUdsWatcher) SaveLocal ¶ added in v0.0.8
func (euw *EtcdUdsWatcher) SaveLocal(k, v string)
func (*EtcdUdsWatcher) ServeSocket ¶
func (euw *EtcdUdsWatcher) ServeSocket(sockFile string)
ServeSocket : Serve unix socket for applications
type GeneralWatcher ¶
type GeneralWatcher struct { }
GeneralWatcher : base struct of watcher
func (*GeneralWatcher) GetTimerCache ¶
func (gw *GeneralWatcher) GetTimerCache() *cache.TimerCacheEtcd
func (*GeneralWatcher) Init ¶
func (gw *GeneralWatcher) Init(tc *cache.TimerCacheEtcd, prefix string, callback func(k, v string))
Init : Initialize configurations from storage while server's up
func (*GeneralWatcher) KeepEyesOnKey ¶
func (gw *GeneralWatcher) KeepEyesOnKey(key string)
KeepEyesOnKey : Specific key watcher
func (*GeneralWatcher) KeepEyesOnKeyWithPrefix ¶
func (gw *GeneralWatcher) KeepEyesOnKeyWithPrefix(module string)
KeepEyesOnKeyWithPrefix : Specific prefix watcher
func (*GeneralWatcher) Watch ¶
func (gw *GeneralWatcher) Watch(tc *cache.TimerCacheEtcd, key string, putCallback func(k, v string), delCallBack func(mk, k string, cancel context.CancelFunc))
Watch : Watching configuration's changes
type MemoryWatcher ¶ added in v0.0.6
type MemoryWatcher struct { GeneralWatcher Tc cache.TimerCache // contains filtered or unexported fields }
EtcdUdsWatcher : Unix domain socket watcher for etcd
func (*MemoryWatcher) Find ¶ added in v0.0.6
func (emw *MemoryWatcher) Find(cmd []string) (string, error)
func (*MemoryWatcher) KeepEyesOnKey ¶ added in v0.0.6
func (emw *MemoryWatcher) KeepEyesOnKey(key string)
KeepEyesOnKey : Watching specific key
func (*MemoryWatcher) KeepEyesOnKeyWithPrefix ¶ added in v0.0.6
func (emw *MemoryWatcher) KeepEyesOnKeyWithPrefix(prefix string)
KeepEyesOnKeyWithPrefix : Watch etcd with prefix
func (*MemoryWatcher) SaveLocal ¶ added in v0.0.8
func (emw *MemoryWatcher) SaveLocal(k, v string)
type SyncFileWorker ¶
type SyncFileWorker struct {
// contains filtered or unexported fields
}
SyncFileWorker : Worker of sync configuration to file
func (*SyncFileWorker) RemoveOne ¶
func (sw *SyncFileWorker) RemoveOne(key interface{})
RemoveOne : Remove one configuration setting
func (*SyncFileWorker) SyncOne ¶
func (sw *SyncFileWorker) SyncOne(key, value interface{})
SyncOne : Sync one configuration setting
type UnixSocket ¶
type UnixSocket struct {
Wch *MemoryWatcher
}
func (*UnixSocket) Serve ¶
func (uxs *UnixSocket) Serve(sockFile string)