Documentation ¶
Overview ¶
Package mongo implements database structures for mongodb.
Index ¶
- type UserBackend
- func (ub *UserBackend) Create(ctx context.Context, u user.User) error
- func (ub *UserBackend) Delete(ctx context.Context, u user.User) error
- func (ub *UserBackend) Read(ctx context.Context, u user.User) (*user.User, error)
- func (ub *UserBackend) Setup(ctx context.Context) error
- func (ub *UserBackend) UpdatePassword(ctx context.Context, u user.User) error
- func (ub *UserBackend) UpdatePointsIncrement(ctx context.Context, usernamePoints map[string]int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserBackend ¶
type UserBackend struct { Users *mongo.Collection db.Config }
UserBackend is a backend manager for a users collection.
func NewUserBackend ¶
NewUserBackend creates a backend manager for the users collection.
func (*UserBackend) Setup ¶
func (ub *UserBackend) Setup(ctx context.Context) error
Setup initializes the backend with appropriate triggers
func (*UserBackend) UpdatePassword ¶
UpdatePassword updates the password for user identified by the username.
func (*UserBackend) UpdatePointsIncrement ¶
func (ub *UserBackend) UpdatePointsIncrement(ctx context.Context, usernamePoints map[string]int) error
UpdatePointsIncrement increments the points for all of the usernames.
Click to show internal directories.
Click to hide internal directories.