Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JwtMiddleware = jwtmiddleware.New(jwtmiddleware.Options{ ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { secretKey := []byte(config.Config.TokenSecretKey) return secretKey, nil }, SigningMethod: jwt.SigningMethodHS256, })
JwtMiddleware is middleware to handle all request
Functions ¶
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller holds DB
func NewController ¶
func NewController(userRepo user.Repository, repo auth.Repository, correspondenceRepo correspondence.Repository) *Controller
NewController constructs a controller
func (*Controller) EmailVerificationHandler ¶
func (c *Controller) EmailVerificationHandler(w http.ResponseWriter, r *http.Request)
EmailVerificationHandler register user
func (*Controller) LoginHandler ¶
func (c *Controller) LoginHandler(w http.ResponseWriter, r *http.Request)
LoginHandler login user
func (*Controller) RegisterHandler ¶
func (c *Controller) RegisterHandler(w http.ResponseWriter, r *http.Request)
RegisterHandler register user
Click to show internal directories.
Click to hide internal directories.