Documentation
¶
Index ¶
Constants ¶
View Source
const ErrCodeEmailAlreadyExists = "email_exists"
View Source
const ErrCodeEmailEmpty = "email_empty"
View Source
const ErrCodeEmailSendTooFrequent = "email_send_too_frequent"
View Source
const ErrCodeEmailTokenInvalid = "email_token_invalid"
View Source
const ErrCodeEmailTooLong = "email_too_long"
View Source
const ErrCodeFirstnameTooLong = "firstname_too_long"
View Source
const ErrCodeLastnameTooLong = "lastname_too_long"
View Source
const ErrCodePasswordEmpty = "password_empty"
View Source
const ErrCodePasswordTooLong = "password_too_long"
View Source
const ErrCodePasswordTooShort = "password_too_short"
View Source
const ErrCodeUserNotFound = "user_not_found"
View Source
const ErrCodeUsernameAlreadyExists = "username_exists"
View Source
const ErrCodeUsernameOrPasswordIncorrect = "username_or_password_incorrect"
View Source
const ErrCodeUsernameReserved = "username_reserved"
View Source
const ErrCodeUsernameTooLong = "username_too_long"
View Source
const ErrCodeUsernameTooShort = "username_too_short"
Variables ¶
View Source
var ErrEmailAlreadyExists = srvcerror.New( ErrCodeEmailAlreadyExists, "epasts jau eksistē", ).SetHttpStatusCode(http.StatusConflict)
View Source
var ErrUserNotFound = srvcerror.New( ErrCodeUserNotFound, "lietotājs netika atrasts", ).SetHttpStatusCode(http.StatusNotFound)
Functions ¶
func NewUserService ¶
func NewUserService(pg *pgxpool.Pool, mailer mail.Mailer, emailCfg EmailFlowConfig) *userSrvc
Types ¶
type CreateUserParams ¶
type EmailFlowConfig ¶ added in v1.1.0
type UserService ¶
type UserService interface {
GetUserByUsername(ctx context.Context, username string) (User, srvcerror.E)
GetUserByUUID(ctx context.Context, uuid uuid.UUID) (User, srvcerror.E)
GetUsernames(ctx context.Context, uuids []uuid.UUID) ([]string, srvcerror.E)
Login(ctx context.Context, username string, password string) (*User, srvcerror.E)
CreateUser(ctx context.Context, user CreateUserParams) (*User, srvcerror.E)
RequestPasswordReset(ctx context.Context, login string) srvcerror.E
ConfirmPasswordReset(ctx context.Context, token string, newPassword string) srvcerror.E
RequestEmailVerification(ctx context.Context, userUUID uuid.UUID) srvcerror.E
ConfirmEmailVerification(ctx context.Context, token string) srvcerror.E
PasswordChangedAt(ctx context.Context, userUUID uuid.UUID) (time.Time, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.