Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var I18nMessages = messages{
EmailEmpty: "error_user_email_empty",
NotFound: "error_user_not_found",
Deleted: "error_user_deleted",
Failed: "error_user_failed",
AlreadyExists: "error_user_already_exists",
InvalidPassword: "error_user_invalid_password",
InvalidUUID: "error_user_invalid_uuid",
RefreshTokenNotAvailable: "error_user_refresh_token_not_available",
TwoFactorStarted: "error_user_two_factor_started",
TokenExpired: "error_user_token_expired",
AlreadyVerified: "error_user_already_verified",
NotVerified: "error_user_not_verified",
TokenNotExpired: "error_user_token_not_expired",
AuthRegisteredMailSubject: "auth_registered_mail_subject",
AnErrorOccurred: "error_user_an_error_occurred",
SubjectVerificationCode: "subject_verification_code",
SMSVerificationCode: "sms_verification_code",
}
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity struct { UUID string `json:"uuid" bson:"_id,omitempty"` Email string `json:"email" bson:"email"` Phone string `json:"phone" bson:"phone"` Roles []string `json:"roles" bson:"roles"` Password []byte `json:"password,omitempty" bson:"password,omitempty"` TwoFactorEnabled bool `json:"twoFactorEnabled" bson:"two_factor_enabled"` IsActive bool `json:"isActive" bson:"is_active"` IsDeleted bool `json:"isDeleted" bson:"is_deleted"` IsVerified bool `json:"isVerified" bson:"is_verified"` VerifyToken string `json:"emailVerifyToken" bson:"email_verify_token"` CreatedAt time.Time `json:"createdAt" bson:"created_at"` UpdatedAt time.Time `json:"updatedAt" bson:"updated_at"` DeletedAt *time.Time `json:"deletedAt" bson:"deleted_at"` }
func (*Entity) CleanPassword ¶
func (e *Entity) CleanPassword()
func (*Entity) SetPassword ¶
type Errors ¶
type Errors interface { NotFound(email string) *i18np.Error AlreadyExists(email string) *i18np.Error Failed(operation string) *i18np.Error InvalidPassword() *i18np.Error AnErrorOccurred() *i18np.Error InvalidUUID() *i18np.Error RefreshTokenNotAvailable() *i18np.Error TwoFactorStarted(token string) *i18np.Error TokenExpired(p interface{}) *i18np.Error AlreadyVerified() *i18np.Error NotVerified(p interface{}) *i18np.Error Deleted() *i18np.Error TokenNotExpired() *i18np.Error }
type EventConfig ¶
type Events ¶
type Events interface {
SendVerification(event SendVerificationEvent)
}
func NewEvents ¶
func NewEvents(cnf EventConfig) Events
type Factory ¶
type Factory struct {
Errors Errors
}
func NewFactory ¶
func NewFactory() Factory
type FilterEntity ¶
type FilterEntity struct {
Query string `query:"q,omitempty" validate:"omitempty,max=500"`
}
type Repo ¶
type Repo interface { GetByUUID(ctx context.Context, uuid string) (*Entity, *i18np.Error) GetByEmail(ctx context.Context, email string) (*Entity, *i18np.Error) GetByToken(ctx context.Context, token string) (*Entity, *i18np.Error) CheckEmail(ctx context.Context, email string) (bool, *i18np.Error) EnableTwoFactor(ctx context.Context, uuid string) *i18np.Error DisableTwoFactor(ctx context.Context, uuid string) *i18np.Error Create(ctx context.Context, entity *Entity) (*Entity, *i18np.Error) SetToken(ctx context.Context, email string, token string) *i18np.Error Verify(ctx context.Context, token string) *i18np.Error AddRoles(ctx context.Context, uuid string, roles []string) *i18np.Error RemoveRoles(ctx context.Context, uuid string, roles []string) *i18np.Error Delete(ctx context.Context, uuid string) *i18np.Error Recover(ctx context.Context, uuid string) *i18np.Error SetPassword(ctx context.Context, uuid string, password []byte) *i18np.Error List(ctx context.Context, filter FilterEntity, listConf list.Config) (*list.Result[*Entity], *i18np.Error) }
type SendVerificationEvent ¶
Click to show internal directories.
Click to hide internal directories.