repository

package
v0.0.0-...-ac88b6b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository interface {
	// Create inserts a new account record into the database. Returns an error if the operation fails.
	Create(account *model.Account) error

	// FindByEmail retrieves an account by its email address from the database. Returns the account and any error encountered.
	FindByEmail(email string) (*model.Account, error)

	// FindByID retrieves an account by its unique identifier. Returns the account model and any error encountered.
	FindByID(id *uuid.UUID) (*model.Account, error)

	// Update updates the details of an existing account in the database. Returns an error if the operation fails.
	Update(account *model.Account) error

	// UpdatePassword updates the hashed password of an account in the database. Returns an error if the update operation fails.
	UpdatePassword(account *model.Account) error

	SetFCMToken(email, fcmToken string) error

	RemoveFCMToken(id uuid.UUID) error
}

AccountRepository defines methods to interact with account-related data in the database.

func NewAccountRepository

func NewAccountRepository(r *Repository) AccountRepository

NewAccountRepository returns an implementation of AccountRepository using the provided Repository.

type NotificationRepository

type NotificationRepository interface {
	GetList(id *uuid.UUID, paging *common.Pagination) (notifications []*model.Notification, count int64, err error)

	MarkAsRead(id uuid.UUID) error
}

func NewNotificationRepository

func NewNotificationRepository(r *Repository) NotificationRepository

type Repository

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

Repository represents a repository that interacts with a database and a Redis cache.

func New

func New(db *gorm.DB, redis *redis.Client) *Repository

New initializes a new Repository with the provided database and redis clients.

Jump to

Keyboard shortcuts

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