Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zzzzer91/gin-middleware
Gin middleware collections.
https://github.com/zzzzer91/gin-middleware
gin golang
Last synced: 26 days ago
JSON representation
Gin middleware collections.
- Host: GitHub
- URL: https://github.com/zzzzer91/gin-middleware
- Owner: zzzzer91
- Created: 2022-09-22T09:12:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T03:12:48.000Z (about 1 year ago)
- Last Synced: 2024-10-15T07:04:32.564Z (2 months ago)
- Topics: gin, golang
- Language: Go
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gin 中间件集合
## 功能
- gincors
- CORS 支持
- gingzip
- gzip 压缩支持
- ginlog
- 替换 Gin 自带的 log middleware;加入了 requestID 字段,并支持链路追踪
- ginmetric
- 导出 Gin 的 prometheus 监控数据
- ginrecovery
- 替换 Gin 自带的 recovery middleware;优化了错误内容
- gintrace
- 使 Gin 支持链路追踪,基于 opentelemetry## 使用
```go
mws := []gin.HandlerFunc{ginmetric.Metrics(), gintrace.Trace(), ginlog.Log(true), ginrecovery.Recovery()}
r := gin.New()
r.Use(mws...)
```