Documentation ¶
Index ¶
- Variables
- func JwtAuth() gin.HandlerFunc
- func Logger() gin.HandlerFunc
- func NewBizErr(msg string) *serverError
- func NewSrvErr(code int, msg string) *serverError
- func Recovery() gin.HandlerFunc
- func ResourceDir(prefixUrl string, resourcesPath string) gin.HandlerFunc
- func ResourceFile(matchUrl string, resourcesPath string) gin.HandlerFunc
- func WithErrHandler(ms ErrHandlerMaps)
- type ErrHandlerMaps
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 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
Click to show internal directories.
Click to hide internal directories.