middleware

package
v0.0.0-...-5110490 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHasNonAuthentication = errors.New("user has not permission")
View Source
var ErrRequestWithNoToken = errors.New("request with no token")
View Source
var HttpInternalServerError = NewSrvErr(http.StatusInternalServerError, "internal server error")
View Source
var HttpMethodNotAllowed = NewSrvErr(http.StatusMethodNotAllowed, "method not allowed")
View Source
var HttpNotFound = NewSrvErr(http.StatusNotFound, "resource not found")

Functions

func JwtAuth

func JwtAuth() gin.HandlerFunc

func Logger

func Logger() gin.HandlerFunc

func NewBizErr

func NewBizErr(msg string) *serverError

func NewSrvErr

func NewSrvErr(code int, msg string) *serverError

func Recovery

func Recovery() gin.HandlerFunc

func ResourceDir

func ResourceDir(prefixUrl string, resourcesPath string) gin.HandlerFunc

func ResourceFile

func ResourceFile(matchUrl string, resourcesPath string) gin.HandlerFunc

func WithErrHandler

func WithErrHandler(ms ErrHandlerMaps)

Types

type ErrHandlerMaps

type ErrHandlerMaps map[error]gin.HandlerFunc

Jump to

Keyboard shortcuts

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