controllers

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllUser

func GetAllUser(c echo.Context) error

GetAllUser - Return all users

func GetDurataionUsers

func GetDurataionUsers(c echo.Context) error

GetDurataionUsers - Return users retrived with pkg/model/duration_data

func InitCustomHandler

func InitCustomHandler()

InitCustomHandler - initialize custom error code and message

func Login

func Login(c echo.Context) error

Login - Define login controller

Types

type JwtCustomClaims

type JwtCustomClaims struct {
	Name string `json:"name"`
	jwt.StandardClaims
}

JwtCustomClaims - Define custom claims for token generation

type Response

type Response struct {
	Status  int         `json:"status"`
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Content interface{} `json:"content"`
}

Response - Define a standard struct response

func (*Response) SetContent

func (r *Response) SetContent(content interface{})

SetContent - Set content of response

func (*Response) SetMessage

func (r *Response) SetMessage(message string)

SetMessage - Set message of response

func (*Response) SetStatus

func (r *Response) SetStatus(status int)

SetStatus - Set the status code of response

func (*Response) SetSuccess

func (r *Response) SetSuccess(success bool)

SetSuccess - Set the result of response

Jump to

Keyboard shortcuts

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