datasync

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func (*MockKeyVal) GetValue

func (mkv *MockKeyVal) GetValue(value proto.Message) error

GetValue returns the associated value.

type MockKeyValIterator

type MockKeyValIterator struct {
	// contains filtered or unexported fields
}

MockKeyValIterator implements KeyValIterator interface.

func (*MockKeyValIterator) GetNext

func (mkvi *MockKeyValIterator) GetNext() (kv datasync.KeyVal, allReceived bool)

GetNext returns the next item in the list.

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".

type ProtoData

type ProtoData struct {
	// contains filtered or unexported fields
}

ProtoData is used to store proto message with revision.

Jump to

Keyboard shortcuts

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