repository

package
v0.0.0-...-7ec3620 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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