client

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

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) Find

func (euw *EtcdUdsWatcher) Find(cmd []string) (string, error)

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) Retry

func (sw *SyncFileWorker) Retry()

Retry implements

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)

type Watcher

type Watcher interface {
	KeepEyesOnKey(key string)
	KeepEyesOnKeyWithPrefix(module string)
	SaveLocal(k, v string)
	Find(cmd []string) (string, error)
}

Watcher : Watching key & value change

type Worker

type Worker interface {
	RemoveOne(key interface{})
	SyncOne(key, value interface{})
	Retry()
}

Worker : Interface of worker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL