Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockChangeEvent ¶
type MockChangeEvent struct { MockKeyVal // contains filtered or unexported fields }
MockChangeEvent implements ChangeEvent interface.
func (*MockChangeEvent) Done ¶
func (mche *MockChangeEvent) Done(err error)
Done stores non-nil error to MockDataSync.
func (*MockChangeEvent) GetChangeType ¶
func (mche *MockChangeEvent) GetChangeType() datasync.Op
GetChangeType returns either "Put" or "Delete".
func (*MockChangeEvent) GetPrevValue ¶
func (mche *MockChangeEvent) GetPrevValue(prevValue proto.Message) (prevValueExist bool, err error)
GetPrevValue returns the previous value.
type MockDataSync ¶
type MockDataSync struct {
// contains filtered or unexported fields
}
MockDataSync can be used to generate datasync events from provided data.
func NewMockDataSync ¶
func NewMockDataSync() *MockDataSync
NewMockDataSync is a constructor for MockDataSync.
func (*MockDataSync) AnyError ¶
func (mds *MockDataSync) AnyError() error
AnyError returns non-nil if any data change or resync event was processed unsuccessfully.
func (*MockDataSync) Delete ¶
func (mds *MockDataSync) Delete(key string) datasync.ChangeEvent
Delete allows to remove value under the given key and to get the corresponding data change event.
func (*MockDataSync) Put ¶
func (mds *MockDataSync) Put(key string, value proto.Message) datasync.ChangeEvent
Put allows to put a new value under the given key and to get the corresponding data change event.
func (*MockDataSync) Resync ¶
func (mds *MockDataSync) Resync(keyPrefix ...string) datasync.ResyncEvent
Resync returns resync event corresponding to a given list of key prefixes and the current state of the mocked data store.
type MockKeyVal ¶
type MockKeyVal struct {
// contains filtered or unexported fields
}
MockKeyVal implements KeyVal interface.
func (*MockKeyVal) GetKey ¶
func (mkv *MockKeyVal) GetKey() string
GetKey returns the associated key.
func (*MockKeyVal) GetRevision ¶
func (mkv *MockKeyVal) GetRevision() (rev int64)
GetRevision returns the associated revision.
type MockKeyValIterator ¶
type MockKeyValIterator struct {
// contains filtered or unexported fields
}
MockKeyValIterator implements KeyValIterator interface.
type MockResyncEvent ¶
type MockResyncEvent struct {
// contains filtered or unexported fields
}
MockResyncEvent implements ResyncEvent interface.
func (*MockResyncEvent) Done ¶
func (mre *MockResyncEvent) Done(err error)
Done stores non-nil error to MockDataSync.
func (*MockResyncEvent) GetValues ¶
func (mre *MockResyncEvent) GetValues() map[string]datasync.KeyValIterator
GetValues returns map "key-prefix->iterator".