Documentation ¶
Index ¶
- Constants
- type Events
- type Quests
- type Store
- type Users
- func (u *Users) CreateUser(ctx context.Context, user *model.UserWithPass) (*model.User, error)
- func (u *Users) DeleteUser(ctx context.Context, id string) error
- func (u *Users) FindUsers(ctx context.Context, filters []model.Filter, offset, limit int64) ([]*model.User, error)
- func (u *Users) GetUser(ctx context.Context, id string) (*model.User, error)
- func (u *Users) GetUserByEmail(ctx context.Context, email string) (*model.User, error)
- func (u *Users) UpdateUser(ctx context.Context, user *model.UserWithPass) (*model.User, error)
Constants ¶
const ( // ErrInvalidFilterValue is returned when a filter value is empty. ErrInvalidFilterValue = errors.Error("invalid_filter_value: invalid filter value") // ErrInvalidFilterMatchType is returned when a filter match type is not found in the supported enum list. ErrInvalidFilterMatchType = errors.Error("invalid_filter_match_type: invalid filter match type") // ErrInvalidFilterField is returned when a filter field is not found in the supported enum list. ErrInvalidFilterField = errors.Error("invalid_filter_field: invalid filter field") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quests ¶
type Quests struct {
// contains filtered or unexported fields
}
Quests provides functionality for CRUD operations on quests.
type Store ¶
type Store interface { InsertUser(ctx context.Context, user *model.UserWithPass) (*model.User, error) UpdateUser(ctx context.Context, user *model.UserWithPass) (*model.User, error) GetUser(ctx context.Context, id string) (*model.User, error) GetUserByEmail(ctx context.Context, email string) (*model.User, error) FindUsers(ctx context.Context, filters []model.Filter, offset, limit int64) ([]*model.User, error) DeleteUser(ctx context.Context, id string) error }
Store represents a type for storing a user in a database.
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users provides functionality for CRUD operations on a user.
func (*Users) CreateUser ¶
CreateUser will try to create a user in our database with the provided data if it represents a unique new user.
func (*Users) DeleteUser ¶
DeleteUser will try to delete an existing user in our database with the provided id.
func (*Users) FindUsers ¶
func (u *Users) FindUsers(ctx context.Context, filters []model.Filter, offset, limit int64) ([]*model.User, error)
FindUsers will retrieve a list of users based on matching all the provided filters and using pagination if limit is gt 0.
func (*Users) GetUser ¶
GetUser will try to get an existing user in our database with the provided id.
func (*Users) GetUserByEmail ¶
func (*Users) UpdateUser ¶
UpdateUser will try to update an existing user in our database with the provided data.