Documentation
¶
Index ¶
- Variables
- func ValidateEmail(v *validator.Validator, email string)
- func ValidateName(v *validator.Validator, name string)
- func ValidatePlainPassword(v *validator.Validator, plainPassword string)
- type Models
- type StateToken
- type StateTokenModel
- type User
- type UserAuthProvider
- type UserCredential
- type UserModel
- type UserWithCredential
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRecordNotFound = errors.New("no record found") ErrDuplicateEmail = errors.New("duplicate email") )
Functions ¶
func ValidateEmail ¶
func ValidateName ¶
func ValidatePlainPassword ¶
Types ¶
type Models ¶
type Models struct {
Users UserModel
Tokens StateTokenModel
}
type StateTokenModel ¶
type StateTokenModel struct {
// contains filtered or unexported fields
}
func NewStateTokenModel ¶
func NewStateTokenModel(db *sql.DB) *StateTokenModel
func (StateTokenModel) Insert ¶
func (s StateTokenModel) Insert(token StateToken) error
func (StateTokenModel) New ¶
func (s StateTokenModel) New(ttl time.Duration) (StateToken, error)
type UserAuthProvider ¶
type UserCredential ¶
type UserModel ¶
type UserModel struct {
// contains filtered or unexported fields
}
func (UserModel) GetByEmail ¶
func (u UserModel) GetByEmail(email string) (UserWithCredential, error)
func (UserModel) Insert ¶
func (u UserModel) Insert(user *UserWithCredential) error
type UserWithCredential ¶
type UserWithCredential struct {
User User
Credential UserCredential
}
Click to show internal directories.
Click to hide internal directories.