Documentation
¶
Index ¶
- Variables
- func BadRequestResponse(ctx *gin.Context, err error)
- func ForbiddenResponse(ctx *gin.Context, err error)
- func GatewayTimeoutResponse(ctx *gin.Context, err error)
- func InternalServerErrorResponse(ctx *gin.Context, err error)
- func NotFoundResponse(ctx *gin.Context, err error)
- func NotImplementedResponse(ctx *gin.Context, err error)
- func ServiceUnavailableResponse(ctx *gin.Context, err error)
- func SuccessResponse(ctx *gin.Context, data interface{})
- func UnauthorizedResponse(ctx *gin.Context, err error)
- type Authorization
- type JwtOptions
- type Response
- type XHttp
- type XJwt
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyToken = errors.New("not found token in header") ErrTokenInvalid = errors.New("token is invalid") )
Functions ¶
func BadRequestResponse ¶
func ForbiddenResponse ¶
func GatewayTimeoutResponse ¶
func NotFoundResponse ¶
func NotImplementedResponse ¶
func SuccessResponse ¶
func UnauthorizedResponse ¶
Types ¶
type Authorization ¶
type Authorization interface { Verify(claims jwt.Claims) bool GetEmptyMyClaims() jwt.Claims }
type JwtOptions ¶
type JwtOptions struct { Secret string Lookup string Auth Authorization }
type XHttp ¶
func (*XHttp) AddOnStartFunc ¶
func (h *XHttp) AddOnStartFunc(fn []func())
func (*XHttp) AddOnStopFunc ¶
func (h *XHttp) AddOnStopFunc(fn []func())
func (*XHttp) RegisterGlobalMiddleware ¶
type XJwt ¶
type XJwt struct { Secret []byte LookupKey string Auth Authorization }
func NewXJwt ¶
func NewXJwt(options JwtOptions) *XJwt
func (*XJwt) GenerateToken ¶
func (*XJwt) Middleware ¶
func (j *XJwt) Middleware(exception map[string]byte) gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.