repository

package
v0.0.0-...-9cc13de Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDBFile

func DeleteDBFile(filesDir string) error

Types

type DB

type DB struct {
	*sqlx.DB
}

func OpenDB

func OpenDB(filesDir string, key int) (*DB, error)

func (*DB) RunMigrations

func (db *DB) RunMigrations() error

type LatestMsgs

type LatestMsgs map[string]*domain.LatestMsgBody

type LocalConversationRepository

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

func NewLocalConversationRepository

func NewLocalConversationRepository(db *DB) LocalConversationRepository

func (LocalConversationRepository) DeleteAllConversations

func (r LocalConversationRepository) DeleteAllConversations() error

func (LocalConversationRepository) GetConversationByUserID

func (r LocalConversationRepository) GetConversationByUserID(id string) (*domain.Conversation, error)

func (LocalConversationRepository) GetConversations

func (r LocalConversationRepository) GetConversations() ([]*domain.Conversation, error)

func (LocalConversationRepository) SaveConversations

func (r LocalConversationRepository) SaveConversations(convos ...*domain.Conversation) error

type LocalMessageRepository

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

func NewLocalMessageRepository

func NewLocalMessageRepository(db *DB) LocalMessageRepository

func (LocalMessageRepository) DeleteAllForSenderAndReceiver

func (r LocalMessageRepository) DeleteAllForSenderAndReceiver(senderId, receiverId string) error

func (LocalMessageRepository) DeleteMsg

func (r LocalMessageRepository) DeleteMsg(id string) error

func (LocalMessageRepository) GetLatestMsgBodyForConvos

func (r LocalMessageRepository) GetLatestMsgBodyForConvos(cui ...string) (LatestMsgs, error)

func (LocalMessageRepository) GetMsgByID

func (r LocalMessageRepository) GetMsgByID(id string) (*domain.Message, error)

func (LocalMessageRepository) GetMsgsAsPage

func (r LocalMessageRepository) GetMsgsAsPage(
	sen string,
	fil domain.Filter,
) ([]*domain.Message, *domain.Metadata, error)

func (LocalMessageRepository) SaveMsg

func (r LocalMessageRepository) SaveMsg(msg *domain.Message) error

func (LocalMessageRepository) UpdateMsg

func (r LocalMessageRepository) UpdateMsg(msg *domain.Message) error

type LocalRepository

func NewLocalRepository

func NewLocalRepository(db *DB) *LocalRepository

type LocalUserRepository

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

func (LocalUserRepository) DeletePreviousUser

func (r LocalUserRepository) DeletePreviousUser() error

func (LocalUserRepository) GetCurrentUser

func (r LocalUserRepository) GetCurrentUser() (*domain.User, error)

func (LocalUserRepository) SaveCurrentUser

func (r LocalUserRepository) SaveCurrentUser(u *domain.User) error

func (LocalUserRepository) UpdateCurrentUser

func (r LocalUserRepository) UpdateCurrentUser(u *domain.User) error

Jump to

Keyboard shortcuts

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