Documentation ¶
Index ¶
- func New(cfg *config.Database) (*pg.DB, error)
- type AccountDB
- type UserDB
- func (u *UserDB) Delete(user *model.User) error
- func (u *UserDB) FindByToken(token string) (*model.User, error)
- func (u *UserDB) FindByUsername(uname string) (*model.User, error)
- func (u *UserDB) List(qp *model.ListQuery, p *model.Pagination) ([]model.User, error)
- func (u *UserDB) Update(user *model.User) (*model.User, error)
- func (u *UserDB) View(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 ¶
List returns list of all users retreivable for the current user, depending on role
Click to show internal directories.
Click to hide internal directories.