databases

package
v0.0.0-...-606cdbc Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidID

type InvalidID struct {
}

func (InvalidID) Error

func (id InvalidID) Error() string

type MessageDB

type MessageDB struct {
	// TODO: Change to a channel cache when channels are implemented
	MessageCache       map[string]*pb.Message
	MessageCacheExpiry map[string]time.Time
}

func NewMessageDB

func NewMessageDB() *MessageDB

func (MessageDB) FetchMessage

func (db MessageDB) FetchMessage(id string) (*pb.Message, error)

func (MessageDB) FetchMessagesAfter

func (db MessageDB) FetchMessagesAfter(t time.Time) (*pb.MessageHistory, error)

func (*MessageDB) GetMessage

func (db *MessageDB) GetMessage(id string) *pb.Message

func (MessageDB) MaybeGetMessage

func (db MessageDB) MaybeGetMessage(id string) (*pb.Message, error)

func (*MessageDB) NewMessage

func (db *MessageDB) NewMessage(cMsg *pb.CreateMessage, userID string, sync ...bool) *pb.Message

func (*MessageDB) PurgeCache

func (db *MessageDB) PurgeCache()

Jump to

Keyboard shortcuts

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