Documentation
¶
Index ¶
- Variables
- type UserModel
- func (m *UserModel) Create(email, password string) (domain.User, error)
- func (m *UserModel) DeleteAdmin(userID domain.UserID) error
- func (m *UserModel) GetAll() ([]domain.User, error)
- func (m *UserModel) GetAllAdmins() ([]domain.UserID, error)
- func (m *UserModel) GetFromEmail(email string) (domain.User, error)
- func (m *UserModel) GetFromEmailPassword(email, password string) (domain.User, error)
- func (m *UserModel) GetFromID(userID domain.UserID) (domain.User, error)
- func (m *UserModel) IsAdmin(userID domain.UserID) bool
- func (m *UserModel) MakeAdmin(userID domain.UserID) error
- func (m *UserModel) PrepareStatements()
- func (m *UserModel) UpdatePassword(userID domain.UserID, password string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadAuth = errors.New("Authentication incorrect")
ErrBadAuth is returned when a user name / passwordcombintaion is incorrect
View Source
var ErrEmailExists = errors.New("Email exists")
ErrEmailExists is self-explanatory
Functions ¶
This section is empty.
Types ¶
type UserModel ¶
UserModel represents the model for app
func (*UserModel) DeleteAdmin ¶
DeleteAdmin removes the user id from the tableof admin users for this server.
func (*UserModel) GetAllAdmins ¶
GetAllAdmins returns the list of user ids that are admins
func (*UserModel) GetFromEmail ¶
GetFromEmail returns a user it retunrs sql.ErrNoRows if not found
func (*UserModel) GetFromEmailPassword ¶
GetFromEmailPassword is the proverbial authentication function
func (*UserModel) PrepareStatements ¶
func (m *UserModel) PrepareStatements()
PrepareStatements prepares the statements
Click to show internal directories.
Click to hide internal directories.