Documentation ¶
Overview ¶
Package filestore is a filesystem-based implementation of the MessageStore interface.
Index ¶
- type FileMessageStore
- func (fms *FileMessageStore) Check() error
- func (fms *FileMessageStore) DoInTx(partition string, fnToExecute func(maxMessageId uint64) error) error
- func (fms *FileMessageStore) Fetch(req *store.FetchRequest)
- func (fms *FileMessageStore) GenerateNextMsgID(partitionName string, nodeID uint8) (uint64, int64, error)
- func (fms *FileMessageStore) MaxMessageID(partition string) (uint64, error)
- func (fms *FileMessageStore) Partition(partition string) (store.MessagePartition, error)
- func (fms *FileMessageStore) Partitions() (partitions []store.MessagePartition, err error)
- func (fms *FileMessageStore) Stop() error
- func (fms *FileMessageStore) Store(partition string, msgID uint64, msg []byte) error
- func (fms *FileMessageStore) StoreMessage(message *protocol.Message, nodeID uint8) (int, error)
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 (*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 ¶
StoreMessage is a part of the `store.MessageStore` implementation.