Documentation ¶
Index ¶
- Constants
- Variables
- func CORSMiddleware() gin.HandlerFunc
- func CasbinMiddleware() gin.HandlerFunc
- func InitAuth() (*jwt.GinJWTMiddleware, error)
- func LocalFile(root string, indexes bool) *localFileSystem
- func OperationLogMiddleware() gin.HandlerFunc
- func RateLimitMiddleware(fillInterval time.Duration, capacity int64) gin.HandlerFunc
- func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc
- func ServeRoot(urlPrefix, root string) gin.HandlerFunc
- type ServeFileSystem
Constants ¶
View Source
const INDEX = "index.html"
Variables ¶
View Source
var OperationLogChan = make(chan *model.OperationLog, 30)
操作日志channel
Functions ¶
func OperationLogMiddleware ¶
func OperationLogMiddleware() gin.HandlerFunc
func RateLimitMiddleware ¶
func RateLimitMiddleware(fillInterval time.Duration, capacity int64) gin.HandlerFunc
func Serve ¶
func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc
Static returns a middleware handler that serves static files in the given directory.
func ServeRoot ¶
func ServeRoot(urlPrefix, root string) gin.HandlerFunc
Types ¶
type ServeFileSystem ¶
type ServeFileSystem interface { http.FileSystem Exists(prefix string, path string) bool }
func EmbedFolder ¶
func EmbedFolder(fsEmbed embed.FS, targetPath string) ServeFileSystem
Click to show internal directories.
Click to hide internal directories.