userservice

package
v0.0.0-...-fd201ba Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TOTPService

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

func NewTOTPService

func NewTOTPService(log logger.Logger, conf config.Config, totpCache port.TOTPCache) *TOTPService

func (TOTPService) Disable

func (r TOTPService) Disable(ctx context.Context, uow port.UserUnitOfWork, userID uint64, code string) error

func (TOTPService) Enable

func (r TOTPService) Enable(ctx context.Context, uow port.UserUnitOfWork, userID uint64, email string, code string) error

func (TOTPService) Enroll

func (r TOTPService) Enroll(ctx context.Context, email string) (*domain.TOTPKey, error)

func (TOTPService) Get

func (r TOTPService) Get(ctx context.Context, uow port.UserUnitOfWork, userID uint64, email string) (*domain.TOTPKey, error)

func (TOTPService) Verify

func (r TOTPService) Verify(code string, secret string) (bool, error)

type UserService

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

UserService implements port.UserService interface and provides access to the user repository and cache service

func New

func New(log logger.Logger) *UserService

New creates a new user service instance

func (*UserService) Create

func (r *UserService) Create(uow port.UserUnitOfWork, user domain.User) (*domain.User, error)

func (*UserService) GetByEmail

func (r *UserService) GetByEmail(uow port.UserUnitOfWork, email string) (*domain.User, error)

func (*UserService) GetByID

func (r *UserService) GetByID(uow port.UserUnitOfWork, id uint64) (user *domain.User, err error)

func (*UserService) GetByUUID

func (r *UserService) GetByUUID(uow port.UserUnitOfWork, uuidStr string) (user *domain.User, err error)

func (*UserService) IsEmailUnique

func (r *UserService) IsEmailUnique(uow port.UserUnitOfWork, email string) error

func (*UserService) List

func (r *UserService) List(uow port.UserUnitOfWork) ([]*domain.User, error)

func (*UserService) MarkWelcomeMessageSent

func (r *UserService) MarkWelcomeMessageSent(uow port.UserUnitOfWork, id uint64) error

func (*UserService) UpdateGoogleID

func (r *UserService) UpdateGoogleID(uow port.UserUnitOfWork, id uint64, googleID string) error

func (*UserService) UpdateLastLoginTime

func (r *UserService) UpdateLastLoginTime(uow port.UserUnitOfWork, id uint64) error

func (*UserService) UpdatePassword

func (r *UserService) UpdatePassword(uow port.UserUnitOfWork, id uint64, password string) error

func (*UserService) VerifiedEmail

func (r *UserService) VerifiedEmail(uow port.UserUnitOfWork, email string) error

Jump to

Keyboard shortcuts

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