Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongPassword = errors.New("wrong password")
Functions ¶
func NewUserUsecase ¶
func NewUserUsecase( userRepo UserRepo, cache UserCache, sessioncache SessionCache, producer UserEventStorage, jwtManager *security.JWTManager, passwordManager *security.PasswordManager, ) *userUsecase
Types ¶
type SessionCache ¶
type UserCache ¶
type UserCache interface { GetUser(ctx context.Context, id int64) (*model.User, error) SetUser(ctx context.Context, user *model.User) error SaveVerificationCode(ctx context.Context, email string, code string) error GetVerificationCode(ctx context.Context, email string) (string, error) InvalidateUser(ctx context.Context, id int64) error InvalidateUsersList(ctx context.Context) error }
type UserEventStorage ¶
type UserRepo ¶
type UserRepo interface { Create(ctx context.Context, user *model.User) (*model.User, error) GetById(ctx context.Context, userID int64) (*model.User, error) GetByEmail(ctx context.Context, email string) (*model.User, error) GetAll(ctx context.Context) ([]*model.User, error) UpdateInfo(ctx context.Context, user *model.UserUpdateData) error UpdatePassword(ctx context.Context, user *model.UserUpdateData) error Delete(ctx context.Context, userID int64) error ChangeUserRole(ctx context.Context, userID int64, newRole string) error VerifyEmail(ctx context.Context, email string) error }
Click to show internal directories.
Click to hide internal directories.