Documentation
¶
Index ¶
- Variables
- func DeleteToken(ctx context.Context, tokenID uuid.UUID, dbtx db.DBTX) error
- func UpdateUserPassword(ctx context.Context, data UpdateUserPasswordPayload, ...) error
- type MakeUserAdminPayload
- type MetaInformation
- type NewTokenPayload
- type NewUserPayload
- type Resource
- type Scope
- type Token
- type UpdateUserPasswordPayload
- type UpdateUserPayload
- type UserEntity
- func GetUser(ctx context.Context, id uuid.UUID, dbtx db.DBTX) (UserEntity, error)
- func GetUserByEmail(ctx context.Context, email string, dbtx db.DBTX) (UserEntity, error)
- func MakeUserAdmin(ctx context.Context, data MakeUserAdminPayload, dbtx db.DBTX) (UserEntity, error)
- func NewUser(ctx context.Context, data NewUserPayload, dbtx db.DBTX, ...) (UserEntity, error)
- func UpdateUser(ctx context.Context, data UpdateUserPayload, dbtx db.DBTX) (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
Types ¶
type MakeUserAdminPayload ¶ added in v0.17.1
type MetaInformation ¶
type NewTokenPayload ¶
type NewTokenPayload struct { Expiration time.Time `validate:"required"` Meta MetaInformation `validate:"required"` }
type NewUserPayload ¶
type Token ¶
type Token struct { ID uuid.UUID CreatedAt time.Time Expiration time.Time Hash string Plain string Meta MetaInformation }
type UpdateUserPayload ¶
type UserEntity ¶
type UserEntity struct { ID uuid.UUID CreatedAt time.Time UpdatedAt time.Time Email string EmailVerifiedAt time.Time IsAdmin bool }
func GetUserByEmail ¶
func MakeUserAdmin ¶ added in v0.17.1
func MakeUserAdmin( ctx context.Context, data MakeUserAdminPayload, dbtx db.DBTX, ) (UserEntity, error)
func NewUser ¶
func NewUser( ctx context.Context, data NewUserPayload, dbtx db.DBTX, hash func(password string) (string, error), ) (UserEntity, error)
func UpdateUser ¶
func UpdateUser( ctx context.Context, data UpdateUserPayload, dbtx db.DBTX, ) (UserEntity, error)
func (UserEntity) IsVerified ¶
func (ue UserEntity) IsVerified() bool
Click to show internal directories.
Click to hide internal directories.