client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 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) KeepEyesOnKey

func (ecw *EtcdFileWatcher) KeepEyesOnKey(key string)

KeepEyesOnKey : Watching specific key

func (*EtcdFileWatcher) KeepEyesOnKeyWithPrefix

func (ecw *EtcdFileWatcher) KeepEyesOnKeyWithPrefix(module string)

KeepEyesOnKeyWithPrefix : Watching specific prefix

type EtcdMemoryWatcher

type EtcdMemoryWatcher struct {
	GeneralWatcher

	Tc *cache.TimerCacheEtcd
	// contains filtered or unexported fields
}

EtcdUdsWatcher : Unix domain socket watcher for etcd

func (*EtcdMemoryWatcher) Find

func (emw *EtcdMemoryWatcher) Find(cmd []string) (string, error)

func (*EtcdMemoryWatcher) KeepEyesOnKey

func (emw *EtcdMemoryWatcher) KeepEyesOnKey(key string)

KeepEyesOnKey : Watching specific key

func (*EtcdMemoryWatcher) KeepEyesOnKeyWithPrefix

func (emw *EtcdMemoryWatcher) KeepEyesOnKeyWithPrefix(prefix string)

KeepEyesOnKeyWithPrefix : Watch etcd with prefix

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) 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 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 *EtcdMemoryWatcher
}

func (*UnixSocket) Serve

func (uxs *UnixSocket) Serve(sockFile string)

type Watcher

type Watcher interface {
	KeepEyesOnKey(key string)
	KeepEyesOnKeyWithPrefix(module string)
}

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