middleware

package
v0.0.0-...-c780586 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextMDTokenKey = "token"
)

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(r *ghttp.Request)

CheckToken 检查token是否有效

func GetIPLimiter

func GetIPLimiter(ip string) *rate.Limiter

func GetOpenID

func GetOpenID(r *ghttp.Request) (string, error)

GetOpenID 获取OpenID

func GetTokenFromContext

func GetTokenFromContext(ctx context.Context) string

从上下文中取出token

func LimitIPRate

func LimitIPRate(handler http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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