2019-10-13 14:39:24 +08:00
2019-10-13 14:39:24 +08:00
2019-10-10 19:37:13 +08:00
2019-10-13 14:39:24 +08:00
2019-08-23 17:37:03 +08:00
2019-09-22 19:23:45 +08:00
2019-10-13 14:39:24 +08:00
2019-10-13 14:39:24 +08:00
2019-08-30 19:33:24 +08:00
2019-10-10 18:24:39 +08:00

go-gin-api

基于 Gin 进行模块化设计的 API 框架,封装了常用的功能,使用简单,致力于进行快速的业务研发。

持续更新...

Features

  • 使用 go modules 初始化项目
  • 安装 Gin 框架
  • 支持优雅地重启或停止
  • 规划项目目录
  • 参数验证validator.v9
    • 模型绑定和验证
    • 自定义验证器
  • 路由中间件
    • 签名验证
      • MD5 组合加密
      • AES 对称加密
      • RSA 非对称加密
    • 日志记录
    • 异常捕获
    • 链路追踪Jaeger
    • 限流
  • 自定义告警
    • 邮件gomail
    • 微信
    • 短信
    • 钉钉
  • 存储
    • MySQL
    • Redis
    • MongoDB
  • gRPC
  • ...

Download

git clone https://github.com/xinliangnote/go-gin-api.git

Quick start

Requirements

  • Go version >= 1.12
  • Global environment configure (Linux/Mac)
export GO111MODULE=on
export GOPROXY=https://goproxy.io

Build & Run

cd go-gin-api

go run main.go

输出如下,表示 Http Server 启动成功。
|-----------------------------------|
|            go-gin-api             |
|-----------------------------------|
|  Go Http Server Start Successful  |
|    Port:9999     Pid:xxxxx        |
|-----------------------------------|

HTTP Demo

curl -X POST http://127.0.0.1:9999/product

Jaeger 链路追踪 Demo

http://127.0.0.1:9999/jaeger_test

Jaeger 链路追踪效果

Documents

Learning together

Description
No description provided
Readme 5.1 MiB
Languages
Go 59.8%
HTML 29.8%
JavaScript 10%
Batchfile 0.2%
Shell 0.1%
Other 0.1%