backend

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

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