auth

package
v0.0.0-...-05fee8b Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 7 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(service types.AuthService) *Handler

func (*Handler) ForgotPassword

func (h *Handler) ForgotPassword(w http.ResponseWriter, r *http.Request)

func (*Handler) Login

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

func (*Handler) RegisterRoutes

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

func (*Handler) Signup

func (h *Handler) Signup(w http.ResponseWriter, r *http.Request)

type Repository

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

func NewRepository

func NewRepository(db *gorm.DB) *Repository

func (*Repository) CreateUser

func (r *Repository) CreateUser(user *types.User) error

func (*Repository) GetUserByEmail

func (r *Repository) GetUserByEmail(email string) (*types.User, error)

func (*Repository) GetUserByUsername

func (r *Repository) GetUserByUsername(username string) (*types.User, error)

func (*Repository) IsEmailExist

func (r *Repository) IsEmailExist(email string) bool

func (*Repository) IsUsernameExist

func (r *Repository) IsUsernameExist(username string) bool

type Service

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

func NewService

func NewService(repo types.AuthRepository) *Service

func (*Service) Login

func (s *Service) Login(params types.LoginDTO) (*types.LoginResponse, error)

func (*Service) Signup

func (s *Service) Signup(params types.SignupDTO) error

Jump to

Keyboard shortcuts

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