Documentation
¶
Index ¶
- type MockedCluster
- func (mc *MockedCluster) Close(wg *sync.WaitGroup)
- func (mc *MockedCluster) CloseServer(wg *sync.WaitGroup)
- func (mc *MockedCluster) Delete(key string) error
- func (mc *MockedCluster) DeletePrefix(prefix string) error
- func (mc *MockedCluster) Get(key string) (*string, error)
- func (mc *MockedCluster) GetPrefix(prefix string) (map[string]string, error)
- func (mc *MockedCluster) GetRaw(key string) (*mvccpb.KeyValue, error)
- func (mc *MockedCluster) GetRawPrefix(prefix string) (map[string]*mvccpb.KeyValue, error)
- func (mc *MockedCluster) GetWithOp(key string, ops ...cluster.ClientOp) (map[string]string, error)
- func (mc *MockedCluster) IsLeader() bool
- func (mc *MockedCluster) Layout() *cluster.Layout
- func (mc *MockedCluster) Mutex(name string) (cluster.Mutex, error)
- func (mc *MockedCluster) PurgeMember(member string) error
- func (mc *MockedCluster) Put(key, value string) error
- func (mc *MockedCluster) PutAndDelete(m map[string]*string) error
- func (mc *MockedCluster) PutAndDeleteUnderLease(m map[string]*string) error
- func (mc *MockedCluster) PutUnderLease(key, value string) error
- func (mc *MockedCluster) STM(apply func(concurrency.STM) error) error
- func (mc *MockedCluster) StartServer() (chan struct{}, chan struct{}, error)
- func (mc *MockedCluster) Syncer(pullInterval time.Duration) (cluster.Syncer, error)
- func (mc *MockedCluster) Watcher() (cluster.Watcher, error)
- type MockedSTM
- type MockedSyncer
- func (s *MockedSyncer) Close()
- func (s *MockedSyncer) Sync(key string) (<-chan *string, error)
- func (s *MockedSyncer) SyncPrefix(prefix string) (<-chan map[string]string, error)
- func (s *MockedSyncer) SyncRaw(key string) (<-chan *mvccpb.KeyValue, error)
- func (s *MockedSyncer) SyncRawPrefix(prefix string) (<-chan map[string]*mvccpb.KeyValue, error)
- type MockedWatcher
- func (w *MockedWatcher) Close()
- func (w *MockedWatcher) Watch(key string) (<-chan *string, error)
- func (w *MockedWatcher) WatchPrefix(prefix string) (<-chan map[string]*string, error)
- func (w *MockedWatcher) WatchRaw(key string) (<-chan *clientv3.Event, error)
- func (w *MockedWatcher) WatchRawPrefix(prefix string) (<-chan map[string]*clientv3.Event, error)
- func (w *MockedWatcher) WatchWithOp(key string, ops ...cluster.ClientOp) (<-chan map[string]*string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockedCluster ¶
type MockedCluster struct { MockedIsLeader func() bool MockedLayout func() *cluster.Layout MockedGet func(key string) (*string, error) MockedGetPrefix func(prefix string) (map[string]string, error) MockedGetRaw func(key string) (*mvccpb.KeyValue, error) MockedGetRawPrefix func(prefix string) (map[string]*mvccpb.KeyValue, error) MockedGetWithOp func(key string, ops ...cluster.ClientOp) (map[string]string, error) MockedPut func(key, value string) error MockedPutUnderLease func(key, value string) error MockedPutAndDelete func(map[string]*string) error MockedPutAndDeleteUnderLease func(map[string]*string) error MockedDelete func(key string) error MockedDeletePrefix func(prefix string) error MockedSTM func(apply func(concurrency.STM) error) error MockedWatcher func() (cluster.Watcher, error) MockedSyncer func(pullInterval time.Duration) (cluster.Syncer, error) MockedMutex func(name string) (cluster.Mutex, error) MockedCloseServer func(wg *sync.WaitGroup) MockedStartServer func() (chan struct{}, chan struct{}, error) MockedClose func(wg *sync.WaitGroup) MockedPurgeMember func(member string) error }
MockedCluster defines a mocked cluster
func NewMockedCluster ¶
func NewMockedCluster() *MockedCluster
NewMockedCluster creates a new mocked cluster
func (*MockedCluster) Close ¶
func (mc *MockedCluster) Close(wg *sync.WaitGroup)
Close implements interface function Close
func (*MockedCluster) CloseServer ¶
func (mc *MockedCluster) CloseServer(wg *sync.WaitGroup)
CloseServer implements interface function CloseServer
func (*MockedCluster) Delete ¶
func (mc *MockedCluster) Delete(key string) error
Delete implements interface function Delete
func (*MockedCluster) DeletePrefix ¶
func (mc *MockedCluster) DeletePrefix(prefix string) error
DeletePrefix implements interface function DeletePrefix
func (*MockedCluster) Get ¶
func (mc *MockedCluster) Get(key string) (*string, error)
Get implements interface function Get
func (*MockedCluster) GetPrefix ¶
func (mc *MockedCluster) GetPrefix(prefix string) (map[string]string, error)
GetPrefix implements interface function GetPrefix
func (*MockedCluster) GetRaw ¶
func (mc *MockedCluster) GetRaw(key string) (*mvccpb.KeyValue, error)
GetRaw implements interface function GetRaw
func (*MockedCluster) GetRawPrefix ¶
GetRawPrefix implements interface function GetRawPrefix
func (*MockedCluster) IsLeader ¶
func (mc *MockedCluster) IsLeader() bool
IsLeader implements interface function IsLeader
func (*MockedCluster) Layout ¶
func (mc *MockedCluster) Layout() *cluster.Layout
Layout implements interface function Layout
func (*MockedCluster) Mutex ¶
func (mc *MockedCluster) Mutex(name string) (cluster.Mutex, error)
Mutex implements interface function Mutex
func (*MockedCluster) PurgeMember ¶
func (mc *MockedCluster) PurgeMember(member string) error
PurgeMember implements interface function PurgeMember
func (*MockedCluster) Put ¶
func (mc *MockedCluster) Put(key, value string) error
Put implements interface function Put
func (*MockedCluster) PutAndDelete ¶
func (mc *MockedCluster) PutAndDelete(m map[string]*string) error
PutAndDelete implements interface function PutAndDelete
func (*MockedCluster) PutAndDeleteUnderLease ¶
func (mc *MockedCluster) PutAndDeleteUnderLease(m map[string]*string) error
PutAndDeleteUnderLease implements interface function PutAndDeleteUnderLease
func (*MockedCluster) PutUnderLease ¶
func (mc *MockedCluster) PutUnderLease(key, value string) error
PutUnderLease implements interface function PutUnderLease
func (*MockedCluster) STM ¶
func (mc *MockedCluster) STM(apply func(concurrency.STM) error) error
STM implements interface function STM
func (*MockedCluster) StartServer ¶
func (mc *MockedCluster) StartServer() (chan struct{}, chan struct{}, error)
StartServer implements interface function StartServer
type MockedSTM ¶
type MockedSTM struct { // embed concurrency.STM for commit & reset concurrency.STM MockedGet func(key ...string) string MockedPut func(key, val string, opts ...clientv3.OpOption) MockedRev func(key string) int64 MockedDel func(key string) }
MockedSTM is a mocked cocurrency.STM
type MockedSyncer ¶
type MockedSyncer struct { MockedSync func(string) (<-chan *string, error) MockedSyncRaw func(string) (<-chan *mvccpb.KeyValue, error) MockedSyncPrefix func(string) (<-chan map[string]string, error) MockedSyncRawPrefix func(string) (<-chan map[string]*mvccpb.KeyValue, error) MockedClose func() }
MockedSyncer is a mock for cluster.Syncer
func (*MockedSyncer) Close ¶
func (s *MockedSyncer) Close()
Close implements interface function Close
func (*MockedSyncer) Sync ¶
func (s *MockedSyncer) Sync(key string) (<-chan *string, error)
Sync implements interface function Sync
func (*MockedSyncer) SyncPrefix ¶
func (s *MockedSyncer) SyncPrefix(prefix string) (<-chan map[string]string, error)
SyncPrefix implements interface function SyncPrefix
func (*MockedSyncer) SyncRaw ¶
func (s *MockedSyncer) SyncRaw(key string) (<-chan *mvccpb.KeyValue, error)
SyncRaw implements interface function SyncRaw
func (*MockedSyncer) SyncRawPrefix ¶
SyncRawPrefix implements interface function SyncRawPrefix
type MockedWatcher ¶
type MockedWatcher struct { MockedWatch func(key string) (<-chan *string, error) MockedWatchPrefix func(prefix string) (<-chan map[string]*string, error) MockedWatchRaw func(key string) (<-chan *clientv3.Event, error) MockedWatchRawPrefix func(prefix string) (<-chan map[string]*clientv3.Event, error) MockedWatchWithOp func(key string, ops ...cluster.ClientOp) (<-chan map[string]*string, error) MockedClose func() }
MockedWatcher defines a mocked watcher
func NewMockedWatcher ¶
func NewMockedWatcher() *MockedWatcher
NewMockedWatcher return MockedWatcher
func (*MockedWatcher) Close ¶
func (w *MockedWatcher) Close()
Close implements interface function Close
func (*MockedWatcher) Watch ¶
func (w *MockedWatcher) Watch(key string) (<-chan *string, error)
Watch implements interface function Watch
func (*MockedWatcher) WatchPrefix ¶
func (w *MockedWatcher) WatchPrefix(prefix string) (<-chan map[string]*string, error)
WatchPrefix implements interface function WatchPrefix
func (*MockedWatcher) WatchRaw ¶
func (w *MockedWatcher) WatchRaw(key string) (<-chan *clientv3.Event, error)
WatchRaw implements interface function WatchRaw
func (*MockedWatcher) WatchRawPrefix ¶
WatchRawPrefix implements interface function WatchRawPrefix
func (*MockedWatcher) WatchWithOp ¶
func (w *MockedWatcher) WatchWithOp(key string, ops ...cluster.ClientOp) (<-chan map[string]*string, error)
WatchWithOp implements interface function WatchWithOp