Documentation ¶
Index ¶
- type Repository
- func (r *Repository) Confirm(userID string, confirmed bool) error
- func (r *Repository) Create(user *entity.User) (*entity.User, error)
- func (r *Repository) Delete(userID string) error
- func (r *Repository) FindByEmail(email string) (*entity.User, error)
- func (r *Repository) FindByID(userID string) (*entity.User, error)
- func (r *Repository) Update(user *entity.User) (*entity.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
Collection *mongo.Collection
}
func NewRepository ¶
func NewRepository(db *mongo.Database) *Repository
Creates new mongo repository for users
func (*Repository) Confirm ¶
func (r *Repository) Confirm(userID string, confirmed bool) error
Confirms user's email Sets true isConfirmed field
func (*Repository) Delete ¶
func (r *Repository) Delete(userID string) error
Deletes user from collection
func (*Repository) FindByEmail ¶
func (r *Repository) FindByEmail(email string) (*entity.User, error)
Finds user by email
Click to show internal directories.
Click to hide internal directories.