Documentation ¶
Index ¶
- func New(cfg *config.Database) (*pg.DB, error)
- type AccountDB
- type UserDB
- func (u *UserDB) Delete(c context.Context, user *model.User) error
- func (u *UserDB) FindByToken(c context.Context, token string) (*model.User, error)
- func (u *UserDB) FindByUsername(c context.Context, uname string) (*model.User, error)
- func (u *UserDB) List(c context.Context, qp *model.ListQuery, p *model.Pagination) ([]model.User, error)
- func (u *UserDB) Update(c context.Context, user *model.User) (*model.User, error)
- func (u *UserDB) UpdateLogin(c context.Context, user *model.User) error
- func (u *UserDB) View(c context.Context, id int) (*model.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountDB ¶
type AccountDB struct {
// contains filtered or unexported fields
}
AccountDB represents the client for user table
func NewAccountDB ¶
NewAccountDB returns a new AccountDB instance
func (*AccountDB) ChangePassword ¶
ChangePassword changes user's password
type UserDB ¶
type UserDB struct {
// contains filtered or unexported fields
}
UserDB represents the client for user table
func (*UserDB) FindByToken ¶
FindByToken queries for single user by token
func (*UserDB) FindByUsername ¶
FindByUsername queries for single user by username
func (*UserDB) List ¶
func (u *UserDB) List(c context.Context, qp *model.ListQuery, p *model.Pagination) ([]model.User, error)
List returns list of all users retreivable for the current user, depending on role
func (*UserDB) UpdateLogin ¶
UpdateLogin updates last login and refresh token for user
Click to show internal directories.
Click to hide internal directories.