Back to godoc.org
cwtch.im/cwtch / server / storage

Package storage

v0.4.2
Latest Go to latest

The latest major version is .

Published: 5 days ago | License: MIT | Module: cwtch.im/cwtch

Index

type MessageStore

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

MessageStore is a file-backed implementation of MessageStoreInterface

func (*MessageStore) AddMessage

func (ms *MessageStore) AddMessage(gm groups.EncryptedGroupMessage)

AddMessage adds a GroupMessage to the store

func (*MessageStore) Close

func (ms *MessageStore) Close()

Close closes the message store and underlying resources.

func (*MessageStore) FetchMessages

func (ms *MessageStore) FetchMessages() (messages []*groups.EncryptedGroupMessage)

FetchMessages returns all messages from the backing file.

func (*MessageStore) Init

func (ms *MessageStore) Init(appDirectory string, maxBufferLines int, messageCounter metrics.Counter) error

Init sets up a MessageStore of size maxBufferLines (# of messages) backed by filename

type MessageStoreInterface

type MessageStoreInterface interface {
	AddMessage(groups.EncryptedGroupMessage)
	FetchMessages() []*groups.EncryptedGroupMessage
}

MessageStoreInterface defines an interface to interact with a store of cwtch messages.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier