filestore

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: 15 Imported by: 1

Documentation

Overview

Package filestore is a filesystem-based implementation of the MessageStore interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMessageStore

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

FileMessageStore is a struct used by the filesystem-based implementation of the MessageStore interface. It holds the base directory, a map of messagePartitions etc.

func New

func New(basedir string) *FileMessageStore

New returns a new FileMessageStore.

func (*FileMessageStore) Check

func (fms *FileMessageStore) Check() error

Check returns if available storage space is still above a certain threshold.

func (*FileMessageStore) DoInTx

func (fms *FileMessageStore) DoInTx(partition string, fnToExecute func(maxMessageId uint64) error) error

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

func (*FileMessageStore) Fetch

func (fms *FileMessageStore) Fetch(req *store.FetchRequest)

Fetch asynchronously fetches a set of messages defined by the fetch request. It is a part of the `store.MessageStore` implementation.

func (*FileMessageStore) GenerateNextMsgID

func (fms *FileMessageStore) GenerateNextMsgID(partitionName string, nodeID uint8) (uint64, int64, error)

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

func (*FileMessageStore) MaxMessageID

func (fms *FileMessageStore) MaxMessageID(partition string) (uint64, error)

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

func (*FileMessageStore) Partition

func (fms *FileMessageStore) Partition(partition string) (store.MessagePartition, error)

func (*FileMessageStore) Partitions

func (fms *FileMessageStore) Partitions() (partitions []store.MessagePartition, err error)

Partitions will walk the filesystem and return all message partitions TODO Bogdan This is not required anymore as the store already read the partitions and saved them in the cacheEntry for the store. Retrieve from there if possible

func (*FileMessageStore) Stop

func (fms *FileMessageStore) Stop() error

Stop the FileMessageStore. Implements the service.stopable interface.

func (*FileMessageStore) Store

func (fms *FileMessageStore) Store(partition string, msgID uint64, msg []byte) error

Store stores a message within a partition. It is a part of the `store.MessageStore` implementation.

func (*FileMessageStore) StoreMessage

func (fms *FileMessageStore) 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