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.
Click to show internal directories.
Click to hide internal directories.