usecase

package
v0.0.0-...-1cbb08c Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type IUserUseCase

type IUserUseCase interface {
	Create(ctx context.Context, userModel *postgresModel.User) (*postgresModel.User, error)

	GetUsers(ctx context.Context, arg ...func(*gorm.DB)) ([]*entity.User, error)

	GetUserById(ctx context.Context, id int64) (*postgresModel.User, error)

	GetUserByUsername(ctx context.Context, username string) (*postgresModel.User, error)

	HashPassword(password string) (string, error)

	CheckPasswordHash(password, hash string) (bool, error)
}

type UserUseCase

type UserUseCase struct {
	PostgresUserRepo         postgresRepo.IUserRepository
	RedisUserCacheRepository redisRepo.IUserCacheRepository
}

func (*UserUseCase) CheckPasswordHash

func (u *UserUseCase) CheckPasswordHash(password, hash string) (bool, error)

func (*UserUseCase) Create

func (u *UserUseCase) Create(ctx context.Context, userModel *postgresModel.User) (*postgresModel.User, error)

func (*UserUseCase) GetUserById

func (u *UserUseCase) GetUserById(ctx context.Context, id int64) (*postgresModel.User, error)

func (*UserUseCase) GetUserByUsername

func (u *UserUseCase) GetUserByUsername(ctx context.Context, username string) (*postgresModel.User, error)

func (*UserUseCase) GetUsers

func (u *UserUseCase) GetUsers(ctx context.Context, arg ...func(*gorm.DB)) ([]*entity.User, error)

func (*UserUseCase) HashPassword

func (u *UserUseCase) HashPassword(password string) (string, error)

Jump to

Keyboard shortcuts

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