Documentation
¶
Index ¶
- Variables
- func DeleteToken(ctx context.Context, dbtx db.DBTX, tokenID uuid.UUID) error
- func HashPassword(password string) []byte
- func UpdateUserEmailToVerified(ctx context.Context, dbtx db.DBTX, data UpdateUserEmailToVerifiedPayload) error
- func UpdateUserPassword(ctx context.Context, dbtx db.DBTX, data UpdateUserPasswordPayload) error
- type MakeUserAdminPayload
- type MetaInformation
- type NewTokenPayload
- type NewUserPayload
- type PasswordPair
- type Resource
- type Scope
- type Token
- func GetHashedToken(ctx context.Context, dbtx db.DBTX, token string) (Token, error)
- func GetToken(ctx context.Context, dbtx db.DBTX, token string) (Token, error)
- func NewCodeToken(ctx context.Context, dbtx db.DBTX, data NewTokenPayload) (Token, error)
- func NewHashedToken(ctx context.Context, dbtx db.DBTX, data NewTokenPayload) (Token, error)
- func NewToken(ctx context.Context, dbtx db.DBTX, data NewTokenPayload) (Token, error)
- type UpdateUserEmailToVerifiedPayload
- type UpdateUserPasswordPayload
- type UpdateUserPayload
- type UserEntity
- func GetUser(ctx context.Context, dbtx db.DBTX, id uuid.UUID) (UserEntity, error)
- func GetUserByEmail(ctx context.Context, dbtx db.DBTX, email string) (UserEntity, error)
- func MakeUserAdmin(ctx context.Context, dbtx db.DBTX, data MakeUserAdminPayload) (UserEntity, error)
- func NewUser(ctx context.Context, dbtx db.DBTX, data NewUserPayload) (UserEntity, error)
- func UpdateUser(ctx context.Context, dbtx db.DBTX, data UpdateUserPayload) (UserEntity, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDomainValidation = errors.New("the provided payload failed validations") ErrMustBeAdmin = errors.New( "this action requires the actor to be an admin", ) )
Functions ¶
func DeleteToken ¶ added in v0.18.9
func HashPassword ¶ added in v0.24.3
func UpdateUserEmailToVerified ¶ added in v0.19.2
func UpdateUserPassword ¶
Types ¶
type MakeUserAdminPayload ¶ added in v0.17.1
type MetaInformation ¶
type NewTokenPayload ¶
type NewTokenPayload struct {
Expiration time.Time `validate:"required"`
Meta MetaInformation `validate:"required" json:"meta"`
}
type NewUserPayload ¶
type NewUserPayload struct {
Email string `validate:"required,email"`
Password PasswordPair
}
type PasswordPair ¶ added in v0.19.2
type Token ¶
type Token struct {
ID uuid.UUID
CreatedAt time.Time
Expiration time.Time
Value string
Meta MetaInformation
}
func GetHashedToken ¶ added in v0.24.3
func NewCodeToken ¶ added in v0.24.3
func NewHashedToken ¶ added in v0.24.3
type UpdateUserEmailToVerifiedPayload ¶ added in v0.19.2
type UpdateUserPasswordPayload ¶
type UpdateUserPasswordPayload struct {
ID uuid.UUID `validate:"required,uuid"`
UpdatedAt time.Time `validate:"required"`
Password PasswordPair
}
type UpdateUserPayload ¶
type UserEntity ¶
type UserEntity struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
Email string
EmailVerifiedAt time.Time
IsAdmin bool
HashedPassword string
}
func GetUserByEmail ¶
func MakeUserAdmin ¶ added in v0.17.1
func MakeUserAdmin( ctx context.Context, dbtx db.DBTX, data MakeUserAdminPayload, ) (UserEntity, error)
func NewUser ¶
func NewUser( ctx context.Context, dbtx db.DBTX, data NewUserPayload, ) (UserEntity, error)
func UpdateUser ¶
func UpdateUser( ctx context.Context, dbtx db.DBTX, data UpdateUserPayload, ) (UserEntity, error)
func (UserEntity) IsVerified ¶
func (ue UserEntity) IsVerified() bool
func (UserEntity) ValidatePassword ¶ added in v0.19.2
func (ue UserEntity) ValidatePassword(providedPassword string) error
Click to show internal directories.
Click to hide internal directories.