Documentation ¶
Index ¶
- type UserRepository
- type UserRepositoryImpl
- func (r *UserRepositoryImpl) CheckRefreshToken(UserId int, refreshToken string) (bool, error)
- func (r *UserRepositoryImpl) CheckUserByEmailRegister(email string) (bool, error)
- func (r *UserRepositoryImpl) CheckUserByUsernameRegister(username string) (bool, error)
- func (r *UserRepositoryImpl) CreateUser(user *model.UserRegister) (result sql.Result, err error)
- func (r *UserRepositoryImpl) DeleteRefreshToken(UserId int, refreshToken string) error
- func (r *UserRepositoryImpl) FindUserByEmail(email string) (*model.GetUserPassword, error)
- func (r *UserRepositoryImpl) FindUserByUsername(username string) (*model.GetUserPassword, error)
- func (r *UserRepositoryImpl) UpdateRefreshToken(UserId int, refreshToken string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserRepository ¶
type UserRepository interface { FindUserByUsername(username string) (*model.GetUserPassword, error) FindUserByEmail(email string) (*model.GetUserPassword, error) CheckUserByUsernameRegister(username string) (bool, error) CheckUserByEmailRegister(email string) (bool, error) CreateUser(user *model.UserRegister) (result sql.Result, err error) CheckRefreshToken(UserId int, refreshToken string) (bool, error) UpdateRefreshToken(UserId int, refreshToken string) error DeleteRefreshToken(UserId int, refreshToken string) error }
func NewUserRepository ¶
func NewUserRepository(db *sql.DB, config config.Config) UserRepository
type UserRepositoryImpl ¶
type UserRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*UserRepositoryImpl) CheckRefreshToken ¶
func (r *UserRepositoryImpl) CheckRefreshToken(UserId int, refreshToken string) (bool, error)
func (*UserRepositoryImpl) CheckUserByEmailRegister ¶
func (r *UserRepositoryImpl) CheckUserByEmailRegister(email string) (bool, error)
CheckUserByEmailRegister checks if a user with the given email already exists
func (*UserRepositoryImpl) CheckUserByUsernameRegister ¶
func (r *UserRepositoryImpl) CheckUserByUsernameRegister(username string) (bool, error)
CheckUserByUsernameRegister checks if a user with the given username already exists
func (*UserRepositoryImpl) CreateUser ¶
func (r *UserRepositoryImpl) CreateUser(user *model.UserRegister) (result sql.Result, err error)
CreateUser inserts a new user into the database
func (*UserRepositoryImpl) DeleteRefreshToken ¶
func (r *UserRepositoryImpl) DeleteRefreshToken(UserId int, refreshToken string) error
func (*UserRepositoryImpl) FindUserByEmail ¶
func (r *UserRepositoryImpl) FindUserByEmail(email string) (*model.GetUserPassword, error)
FindUserByEmail retrieves a user by their email
func (*UserRepositoryImpl) FindUserByUsername ¶
func (r *UserRepositoryImpl) FindUserByUsername(username string) (*model.GetUserPassword, error)
func (*UserRepositoryImpl) UpdateRefreshToken ¶
func (r *UserRepositoryImpl) UpdateRefreshToken(UserId int, refreshToken string) error
Click to show internal directories.
Click to hide internal directories.