Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is used when a specific Product is requested but does not exist. ErrNotFound = errors.New("not found") // ErrInvalidID occurs when an ID is not in a valid form. ErrInvalidID = errors.New("ID is not in its proper form") // ErrDuplicateEmail occus when the email exists in the database. ErrDuplicateEmail = errors.New("email already in use") // ErrAuthenticationFailure occurs when a user attempts to authenticate but // anything goes wrong. ErrAuthenticationFailure = errors.New("authentication failed") // ErrForbidden occurs when a user tries to do something that is forbidden to them according to access control policies. ErrForbidden = errors.New("attempted action is not allowed") )
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { ID string `db:"user_id"` Name string `db:"name"` Email string `db:"email"` PasswordHash []byte `db:"password_hash"` Active bool `db:"active"` DateCreated string `db:"created_at"` DateUpdated string `db:"updated_at"` }
Info is the model for a user.
type RepositoryDb ¶
RepositoryDb defines the repository for the user service.
func (RepositoryDb) Authenticate ¶
func (r RepositoryDb) Authenticate(email, password string) (string, error)
Authenticate queries the database for a user with a matching pasword.
func (RepositoryDb) ChangePassword ¶
func (r RepositoryDb) ChangePassword(currentPassword, newPassword, userID string) error
Click to show internal directories.
Click to hide internal directories.