controller

package
v0.0.0-...-974506c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

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

func Register

func Register(urt *mux.Router, db *sql.DB)

Register handlers

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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