account

package
v0.0.0-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOrExpiredOtp  = dto2.NewI18nError("invalid or expired otp", "errors.invalid_or_expired_otp")
	ErrUserNotFound         = dto2.NewI18nError("user not found", "errors.user_not_found")
	ErrDuplicateUsername    = dto2.NewI18nError("username already in use", "errors.duplicate_username")
	ErrDuplicateEmail       = dto2.NewI18nError("email already in use", "errors.duplicate_email")
	ErrPasswordIsSet        = dto2.NewI18nError("password is already set", "errors.password_is_set")
	ErrIncorrectOldPassword = dto2.NewI18nError("incorrect old password", "errors.incorrect_old_password")
	ErrUserNotDeleted       = dto2.NewI18nError("user not deleted", "errors.user_not_deleted")
	ErrUserAlreadyDeleted   = dto2.NewI18nError("user already deleted", "errors.user_already_deleted")
	ErrSendEmail            = dto2.NewI18nError("failed to send email", "errors.failed_to_send_email")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	userRepo repo.UserRepository,
	cacheManager cache.Manager,
	smtpSender smtp.Sender,
	templateEngine template.Engine,
	cfg *config.Config,
) *Service

func (*Service) DeleteAccount

func (s *Service) DeleteAccount(ctx context.Context, id uuid.UUID) error

func (*Service) GetAccount

func (s *Service) GetAccount(ctx context.Context, id uuid.UUID) (dto.AccountOutput, error)

func (*Service) RestoreAccount

func (s *Service) RestoreAccount(ctx context.Context, id uuid.UUID) (dto.AccountOutput, error)

func (*Service) SetPassword

func (s *Service) SetPassword(ctx context.Context, id uuid.UUID, input dto.SetPasswordInput) error

func (*Service) UpdateEmail

func (s *Service) UpdateEmail(
	ctx context.Context, id uuid.UUID, input dto.UpdateEmailInput, localizer *i18n.Localizer,
) (dto.AccountOutput, error)

func (*Service) UpdatePassword

func (s *Service) UpdatePassword(ctx context.Context, id uuid.UUID, input dto.UpdatePasswordInput) error

func (*Service) UpdateUsername

func (s *Service) UpdateUsername(
	ctx context.Context, id uuid.UUID, input dto.UpdateUsernameInput,
) (dto.AccountOutput, error)

func (*Service) VerifyEmail

func (s *Service) VerifyEmail(ctx context.Context, id uuid.UUID, req dto.VerifyEmailInput) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL