Documentation
¶
Overview ¶
Package backend contains code that stores chats and other data into a backend, i.e. firestore
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when the resource was not found ErrNotFound error = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
// ListenForChats listens for chats and updates the cache accordingly
ListenForChats(context.Context, chan struct{})
// GetChatByID retrieves a chat by the id
GetChatByID(int64) (*pb.Chat, error)
// GetChatByUsername retrieves a chat by username
GetChatByUsername(string) (*pb.Chat, error)
// GetAllChatIDs gets all chats
GetAllChats() ([]*pb.Chat, error)
// StoreChat stores a new chat in the database
StoreChat(*pb.Chat) error
// DeleteChat deletes a chat from the database
DeleteChat(int64) error
// Close any client
Close()
}
Backend is a backend that can be used to store and retrieve chats.
Click to show internal directories.
Click to hide internal directories.