middleware

package
v0.0.0-...-7d1b39b Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeFailed = 300
)

Variables

This section is empty.

Functions

func ErrorEncoder

func ErrorEncoder(w netHttp.ResponseWriter, r *netHttp.Request, err error)

func TokenParseAll

func TokenParseAll(keyFunc jwt.Keyfunc) middleware.Middleware

TokenParseAll 所有用户都可以访问,非必须token

Types

type Error

type Error struct {
	StatusCode int32  `json:"status_code"`
	StatusMsg  string `json:"status_msg"`
}

func FromError

func FromError(err error) *Error

func New

func New(statusCode int32, statusMsg string) *Error

func (*Error) Error

func (e *Error) Error() string

type UserIdKey

type UserIdKey string

Jump to

Keyboard shortcuts

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