Documentation ¶
Index ¶
- Constants
- type URepository
- func (r *URepository) DeleteAll() error
- func (r *URepository) DeleteById(id string) error
- func (r *URepository) GetAll() (user []*models.User, err error)
- func (r *URepository) GetByEmail(email string) (user *models.User, err error)
- func (r *URepository) GetById(id string) (user *models.User, err error)
- func (r *URepository) Save(user *models.User) error
- func (r *URepository) Update(user *models.User) error
- type UsersRepository
Constants ¶
View Source
const UsersCollection = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type URepository ¶
type URepository struct {
// contains filtered or unexported fields
}
URepository provides a mongo collection for database job.
func (*URepository) DeleteAll ¶
func (r *URepository) DeleteAll() error
DeleteAll drops users collection.
func (*URepository) DeleteById ¶
func (r *URepository) DeleteById(id string) error
Delete deletes the user based on id.
func (*URepository) GetAll ¶
func (r *URepository) GetAll() (user []*models.User, err error)
GetAll returns all users.
func (*URepository) GetByEmail ¶
func (r *URepository) GetByEmail(email string) (user *models.User, err error)
GetByEmail returns the user based on email.
type UsersRepository ¶
type UsersRepository interface { Save(user *models.User) error GetById(id string) (user *models.User, err error) GetByEmail(email string) (user *models.User, err error) GetAll() (user []*models.User, err error) Update(user *models.User) error DeleteById(id string) error }
UsersRepository is the interface of the authentication backend.
func NewUsersRepository ¶
func NewUsersRepository(conn db.Connection) UsersRepository
NewUsersRepository creates a new UsersRepository instance.
Click to show internal directories.
Click to hide internal directories.