https://github.com/paradeum-team/gin-web-demo
https://github.com/paradeum-team/gin-web-demo
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/paradeum-team/gin-web-demo
- Owner: paradeum-team
- Created: 2019-06-20T08:13:32.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T02:34:29.000Z (about 3 years ago)
- Last Synced: 2026-02-15T06:24:11.558Z (4 months ago)
- Language: Go
- Size: 14.2 MB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 使用gin 框架 搭建自己的 web api
[gin 参考资料](https://github.com/gin-gonic/gin)
---------
## 简述
- 集成golog ,用于业务日志输出
- 集成gprofile,可参数化系统配置。 [参考](https://github.com/flyleft/gprofile)
```
#1.//通过环境变量覆盖配置,
比如设置EUREKA_INSTANCE_LEASERENEWALINTERVALINSECONDS环境变量值覆盖eureka.instance.leaseRenewalIntervalInSeconds
```
- 日志中间件:输出请求的 uri 相关信息
- 集成swagger。自动生成在线api 文档 。访问地址:http://ip:port/[context-path]/api/index.html (eg:http://localhost:8188/dsp/api/index.html)
- 增加 中间件 middlewares[cors,authority],在Bootstrapper 中全局使用
- 修改日志输出模式:同时输出 stdout,file
---
## swagger 具体使用
[swagger](./swagger.md)
[swagger api具体使用 ](https://github.com/swaggo/swag)
## 性能优化工具 pprof
[Golang使用pprof进行性能优化](./pprof.md)