handlers

package
v0.0.0-...-ae7a097 Latest Latest
Warning

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

Go to latest
Published: May 29, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ORM - Global ORM object for the handler package

Functions

func FetchUser

func FetchUser(c *gin.Context)

FetchUser - Gets the user ID from auth token and returns that user form the DB

func LoginHandler

func LoginHandler(c *gin.Context)

LoginHandler - Handler function for the login route

func RegistrationHandler

func RegistrationHandler(c *gin.Context)

RegistrationHandler - Encrypts the new users password and stores user details in the DB

func TokenValidator

func TokenValidator() gin.HandlerFunc

TokenValidator - gin middleware function to validate the jwt tokens in the incoming requests

Types

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

LoginRequest - Login JSON request format

type RegistrationRequest

type RegistrationRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	UserName string `json:"user_name"`
}

RegistrationRequest - Registration request parameter format

Jump to

Keyboard shortcuts

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