Documentation ¶
Index ¶
- type IUserRepositoryInterface
- type UserRepository
- func (usr *UserRepository) CheckToken(token string) (bool, error)
- func (usr *UserRepository) ExistsEmail(email string) (bool, error)
- func (usr *UserRepository) ExistsUsername(userName string) (bool, error)
- func (usr *UserRepository) LogIn(userName string, password string) (string, error)
- func (usr *UserRepository) LogOut(token string) error
- func (usr *UserRepository) Register(user models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IUserRepositoryInterface ¶
type IUserRepositoryInterface interface { Register(user models.User) error LogIn(userName, password string) (string, error) LogOut(token string) error ExistsUsername(userName string) (bool, error) ExistsEmail(email string) (bool, error) CheckToken(token string) (bool, error) }
IUserRepositoryInterface interface of the User repo
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository struct implementation of IUserRepositoryInterface
func NewUserRepository ¶
func NewUserRepository(connString string) (*UserRepository, error)
NewUserRepository function to get new UserRepository
func (*UserRepository) CheckToken ¶
func (usr *UserRepository) CheckToken(token string) (bool, error)
CheckToken function
func (*UserRepository) ExistsEmail ¶
func (usr *UserRepository) ExistsEmail(email string) (bool, error)
ExistsEmail function checks if the given email exists
func (*UserRepository) ExistsUsername ¶
func (usr *UserRepository) ExistsUsername(userName string) (bool, error)
ExistsUsername function checks if the given userName exists
func (*UserRepository) LogIn ¶
func (usr *UserRepository) LogIn(userName string, password string) (string, error)
LogIn Logs In the user
func (*UserRepository) LogOut ¶
func (usr *UserRepository) LogOut(token string) error
LogOut function
Click to show internal directories.
Click to hide internal directories.