user

package
v0.0.0-...-37565ce Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(userStore types.UserStore) *Handler

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(router *mux.Router)

func (*Handler) RegisterUnprotectedRoutes

func (h *Handler) RegisterUnprotectedRoutes(router *mux.Router)

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(db *sql.DB) *Store

func (*Store) CheckProvider

func (s *Store) CheckProvider(email string) (bool, string, error)

func (*Store) CreateUser

func (s *Store) CreateUser(user types.User) error

func (*Store) DelayCodeWithinTime

func (s *Store) DelayCodeWithinTime(email string, minutes int) (bool, error)

func (*Store) DeleteToken

func (s *Store) DeleteToken(userId int) error

func (*Store) DeleteUser

func (s *Store) DeleteUser(user *types.User) error

func (*Store) GetUserByEmail

func (s *Store) GetUserByEmail(email string) (*types.User, error)

func (*Store) GetUserByID

func (s *Store) GetUserByID(id int) (*types.User, error)

func (*Store) GetUserByName

func (s *Store) GetUserByName(name string) (*types.User, error)

func (*Store) GetUserBySearchName

func (s *Store) GetUserBySearchName(name string) ([]types.User, error)

func (*Store) GetUserBySearchPhoneNumber

func (s *Store) GetUserBySearchPhoneNumber(phoneNumber string) ([]types.User, error)

func (*Store) GetUserPasswordByEmail

func (s *Store) GetUserPasswordByEmail(email string) (string, error)

func (*Store) IsAccessTokenExist

func (s *Store) IsAccessTokenExist(userId int) (bool, error)

func (*Store) IsUserExist

func (s *Store) IsUserExist(email string) (bool, error)

func (*Store) ModifyUser

func (s *Store) ModifyUser(id int, user types.User) error

func (*Store) SaveToken

func (s *Store) SaveToken(userId int, accessTokenDetails *types.TokenDetails, refreshTokenDetails *types.TokenDetails) error

func (*Store) SaveVerificationCode

func (s *Store) SaveVerificationCode(email, code string, requestType int) error

func (*Store) UpdateAccessToken

func (s *Store) UpdateAccessToken(userId int, accessTokenDetails *types.TokenDetails) error

func (*Store) UpdateFCMToken

func (s *Store) UpdateFCMToken(id int, fcmToken string) error

func (*Store) UpdateLastLoggedIn

func (s *Store) UpdateLastLoggedIn(id int) error

func (*Store) UpdatePassword

func (s *Store) UpdatePassword(id int, password string) error

func (*Store) UpdateProfilePicture

func (s *Store) UpdateProfilePicture(id int, profPicUrl string) error

func (*Store) UpdateVerificationCodeStatus

func (s *Store) UpdateVerificationCodeStatus(email string, status, reqType int) error

func (*Store) ValidateLoginCodeWithinTime

func (s *Store) ValidateLoginCodeWithinTime(email, code string, minutes, reqType int) (bool, error)

func (*Store) ValidateUserAccessToken

func (s *Store) ValidateUserAccessToken(w http.ResponseWriter, r *http.Request) (*types.User, error)

func (*Store) ValidateUserRefreshToken

func (s *Store) ValidateUserRefreshToken(refreshToken string) (*types.User, error)

Jump to

Keyboard shortcuts

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