Documentation ¶
Overview ¶
users contains database storage actions for user accounts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidLogin = errors.New("incorrect login details")
ErrInvalidLogin is returned when the given login details were incorrect.
View Source
var ErrUserExists = errors.New("the username is in use")
ErrUserExists is returned when the given username already exists.
Functions ¶
func Authenticate ¶
Authenticate returns a user matching the given login details, if one exists.
Types ¶
type AccountList ¶
An AccountList is a slice of user accounts.
func ListUsers ¶
func ListUsers(ctx context.Context, args ListArgs, filter ListFilter) (AccountList, error)
ListUsers returns a list of user accounts.
func (AccountList) Single ¶
func (accs AccountList) Single() *models.Account
Single returns a single account from an account list. If the list contains zero or multiple accounts, it panics.
type ListFilter ¶
type ListFilter struct { // Filter by a list of account IDs. AccountID []int32 // Filter by a username. Username string }
A ListFilter controls the filtering behaviour of ListUsers. At most a single filter variable may be set.
Click to show internal directories.
Click to hide internal directories.