dummystore

package
v0.0.0-...-83e654d Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyMessageStore

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

DummyMessageStore is a minimal implementation of the MessageStore interface. Everything it does is storing the message ids in the key value store to ensure a monotonic incremented id. It is intended for testing and demo purpose, as well as dummy for services without persistence. TODO: implement a simple logic to preserve the last N messages

func New

func New(kvStore kvstore.KVStore) *DummyMessageStore

New returns a new DummyMessageStore.

func (*DummyMessageStore) Check

func (dms *DummyMessageStore) Check() error

func (*DummyMessageStore) DoInTx

func (dms *DummyMessageStore) DoInTx(partition string, fnToExecute func(maxMessageId uint64) error) error

DoInTx is a part of the `store.MessageStore` implementation.

func (*DummyMessageStore) Fetch

func (dms *DummyMessageStore) Fetch(req *store.FetchRequest)

Fetch does nothing in this dummy implementation. It is a part of the `store.MessageStore` implementation.

func (*DummyMessageStore) GenerateNextMsgID

func (dms *DummyMessageStore) GenerateNextMsgID(partitionName string, nodeID uint8) (uint64, int64, error)

GenerateNextMsgID is a part of the `store.MessageStore` implementation.

func (*DummyMessageStore) MaxMessageID

func (dms *DummyMessageStore) MaxMessageID(partition string) (uint64, error)

MaxMessageID is a part of the `store.MessageStore` implementation.

func (*DummyMessageStore) Partition

func (dms *DummyMessageStore) Partition(name string) (store.MessagePartition, error)

func (*DummyMessageStore) Partitions

func (dms *DummyMessageStore) Partitions() ([]store.MessagePartition, error)

func (*DummyMessageStore) Start

func (dms *DummyMessageStore) Start() error

Start the DummyMessageStore.

func (*DummyMessageStore) Stop

func (dms *DummyMessageStore) Stop() error

Stop the DummyMessageStore.

func (*DummyMessageStore) Store

func (dms *DummyMessageStore) Store(partition string, msgID uint64, msg []byte) error

Store is a part of the `store.MessageStore` implementation.

func (*DummyMessageStore) StoreMessage

func (dms *DummyMessageStore) StoreMessage(message *protocol.Message, nodeID uint8) (int, error)

StoreMessage is a part of the `store.MessageStore` implementation.

Jump to

Keyboard shortcuts

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