middleware

package
v0.5.17 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const INDEX = "index.html"

Variables

View Source
var OperationLogChan = make(chan *model.OperationLog, 30)

操作日志channel

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORS跨域中间件

func CasbinMiddleware

func CasbinMiddleware() gin.HandlerFunc

Casbin中间件, 基于RBAC的权限访问控制模型

func InitAuth

func InitAuth() (*jwt.GinJWTMiddleware, error)

初始化jwt中间件

func LocalFile added in v0.5.17

func LocalFile(root string, indexes bool) *localFileSystem

func OperationLogMiddleware

func OperationLogMiddleware() gin.HandlerFunc

func RateLimitMiddleware

func RateLimitMiddleware(fillInterval time.Duration, capacity int64) gin.HandlerFunc

func Serve added in v0.5.17

func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc

Static returns a middleware handler that serves static files in the given directory.

func ServeRoot added in v0.5.17

func ServeRoot(urlPrefix, root string) gin.HandlerFunc

Types

type ServeFileSystem added in v0.5.17

type ServeFileSystem interface {
	http.FileSystem
	Exists(prefix string, path string) bool
}

func EmbedFolder added in v0.5.17

func EmbedFolder(fsEmbed embed.FS, targetPath string) ServeFileSystem

Jump to

Keyboard shortcuts

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