1 Star 0 Fork 0

linxing/youye-core

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gin.go 531 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mark 提交于 2024-01-29 17:39 +08:00 . rename package
package transfer
import (
"net/http"
"github.com/gin-gonic/gin"
)
/**
e.g.
package main
import (
"github.com/gin-gonic/gin"
"gitee.com/linxing_3/youye-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)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linxing_3/youye-core.git
git@gitee.com:linxing_3/youye-core.git
linxing_3
youye-core
youye-core
v0.0.1

搜索帮助