repository

package
v0.0.0-...-d809d1c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationRepository

type ConversationRepository struct {
	DB *DB
}

func NewConversationRepository

func NewConversationRepository(db *DB) *ConversationRepository

func (*ConversationRepository) ConversationExists

func (r *ConversationRepository) ConversationExists(ctx context.Context, senderID, receiverID string) (bool, error)

func (*ConversationRepository) CreateConversation

func (r *ConversationRepository) CreateConversation(ctx context.Context, senderID, receiverID string) error

func (*ConversationRepository) GetConversations

func (r *ConversationRepository) GetConversations(ctx context.Context, usrID string) ([]*domain.Conversation, error)

type DB

type DB struct {
	*sqlx.DB
}

func OpenDB

func OpenDB(cfg *utility.Config) *DB

func (*DB) BeginTx

func (db *DB) BeginTx(ctx context.Context) (*TX, error)

func (*DB) RunInTX

func (db *DB) RunInTX(ctx context.Context, fn func(ctx context.Context) error) error

type MessageRepository

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

func NewMessageRepository

func NewMessageRepository(db *DB) *MessageRepository

func (*MessageRepository) DeleteMessage

func (r *MessageRepository) DeleteMessage(ctx context.Context, mID string) error

func (*MessageRepository) GetByID

func (*MessageRepository) GetUnDeliveredMessages

func (r *MessageRepository) GetUnDeliveredMessages(ctx context.Context, rcvrID string, op domain.MsgOperation, c domain.MsgChan) error

func (*MessageRepository) InsertMessage

func (r *MessageRepository) InsertMessage(ctx context.Context, m *domain.Message) error

type TX

type TX struct {
	*sqlx.Tx
}

type TokenRepository

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

func NewTokenRepository

func NewTokenRepository(db *DB) *TokenRepository

func (*TokenRepository) DeleteAllForUser

func (r *TokenRepository) DeleteAllForUser(ctx context.Context, userID, scope string) error

func (*TokenRepository) Insert

func (r *TokenRepository) Insert(ctx context.Context, token *domain.Token) error

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *DB) *UserRepository

func (*UserRepository) ActivateUser

func (r *UserRepository) ActivateUser(ctx context.Context, user *domain.User) error

func (*UserRepository) ExistsUser

func (r *UserRepository) ExistsUser(ctx context.Context, email string) (bool, error)

func (*UserRepository) GetByQuery

func (r *UserRepository) GetByQuery(
	ctx context.Context,
	paramName, paramValue string,
	filter domain.Filter,
) ([]*domain.User, *domain.Metadata, error)

func (*UserRepository) GetByUniqueField

func (r *UserRepository) GetByUniqueField(ctx context.Context, fieldName, fieldValue string) (*domain.User, error)

func (*UserRepository) GetForToken

func (r *UserRepository) GetForToken(ctx context.Context, scope string, hash []byte) (*domain.User, error)

func (*UserRepository) RegisterUser

func (r *UserRepository) RegisterUser(ctx context.Context, u *domain.User) (string, error)

func (*UserRepository) SetOnlineUsersLastSeen

func (r *UserRepository) SetOnlineUsersLastSeen(ctx context.Context, t time.Time) error

func (*UserRepository) UpdateUser

func (r *UserRepository) UpdateUser(ctx context.Context, u *domain.User) error

Jump to

Keyboard shortcuts

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