middlewares

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware() gin.HandlerFunc

AuthMiddleware 认证中间件

func LimitMiddleware added in v0.1.0

func LimitMiddleware() gin.HandlerFunc

LimitMiddleware 限流中间件

Types

type Limiter added in v0.1.0

type Limiter interface {
	Allow() bool
	Wait(context.Context) error
}
var DefaultLimiter Limiter

type User

type User struct {
	Issuer        string   `json:"iss"`
	Subject       string   `json:"sub"`
	Audience      string   `json:"aud"`
	ExpiresAt     int64    `json:"exp"`
	IssuedAt      int64    `json:"iat"`
	AtHash        string   `json:"at_hash"`
	Email         string   `json:"email"`
	EmailVerified bool     `json:"email_verified"`
	Groups        []string `json:"groups"`
	Name          string   `json:"name"`
}

User user

func GetLoginUser

func GetLoginUser(c *gin.Context) *User

GetLoginUser 获取登录用户

Jump to

Keyboard shortcuts

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