Documentation ¶
Index ¶
- func Context() func(http.Handler) http.Handler
- func Cors() func(http.Handler) http.Handler
- func GetUserInformationFromCtx(ctx context.Context) (*enum.AuthJWT, error)
- func HasLoginFunc(ctx context.Context, obj interface{}, next graphql.Resolver) (interface{}, error)
- func MiddleError(ctx context.Context, err error) *gqlerror.Error
- func RecoverFunc(ctx context.Context, err interface{}) (userMessage error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasLoginFunc ¶
HasLoginFunc 如果是请求需要登录才能访问的接口,则需要判断是否带有 token ,并检测 token 的合法性,如果失败拒绝请求
func MiddleError ¶
MiddleError 全局錯誤處理
func RecoverFunc ¶
RecoverFunc ...
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.