1 Star 0 Fork 0

GoAdmin / admin-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gin.go 539 Bytes
一键复制 编辑 原始数据 按行查看 历史
GoAdmin 提交于 2022-06-08 16:39 . test
package transfer
import (
"net/http"
"github.com/gin-gonic/gin"
)
/**
e.g.
package main
import (
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/transfer"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
r := gin.Default()
r.GET("/monitor", transfer.Handler(promhttp.Handler()))
r.Run(":9999")
}
**/
// Handler http.Handler 转换成 gin.HandlerFunc
func Handler(handler http.Handler) gin.HandlerFunc {
return func(c *gin.Context) {
handler.ServeHTTP(c.Writer, c.Request)
}
}
Go
1
https://gitee.com/GoAdminCore/admin-core.git
git@gitee.com:GoAdminCore/admin-core.git
GoAdminCore
admin-core
admin-core
v1.0.0

搜索帮助