Check message stores implement expected interfaces

This commit is contained in:
Simon Ser 2021-05-18 14:19:34 +02:00
parent b078ccaf7a
commit f6875521ea
2 changed files with 5 additions and 0 deletions

View File

@ -63,6 +63,9 @@ type fsMessageStore struct {
files map[string]*os.File // indexed by entity files map[string]*os.File // indexed by entity
} }
var _ messageStore = (*fsMessageStore)(nil)
var _ chatHistoryMessageStore = (*fsMessageStore)(nil)
func newFSMessageStore(root, username string) *fsMessageStore { func newFSMessageStore(root, username string) *fsMessageStore {
return &fsMessageStore{ return &fsMessageStore{
root: filepath.Join(root, escapeFilename.Replace(username)), root: filepath.Join(root, escapeFilename.Replace(username)),

View File

@ -41,6 +41,8 @@ type memoryMessageStore struct {
buffers map[ringBufferKey]*messageRingBuffer buffers map[ringBufferKey]*messageRingBuffer
} }
var _ messageStore = (*memoryMessageStore)(nil)
func newMemoryMessageStore() *memoryMessageStore { func newMemoryMessageStore() *memoryMessageStore {
return &memoryMessageStore{ return &memoryMessageStore{
buffers: make(map[ringBufferKey]*messageRingBuffer), buffers: make(map[ringBufferKey]*messageRingBuffer),