Skip to content

AutoBingo/Gin-IPs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

项目介绍

本项目用golang创建了一个API服务,代码中包含完整的程序和配置文件。如果有需要使用Gin开发后台API服务的,可以直接Clone/Fork,也欢迎各路大佬一起完善代码。

Gin-API系列文章

编译运行

  • 编译
# cd src
# go build src/main.go
  • 更新配置

根据conf/gin_ips.yamlmgo配置和redis配置新建mongodb数据库和redis,并确认服务正常运行

  • 生成测试数据
# cp -r conf test/conf 
# cd test
# go test -v mock_test.go 
  • 运行
# cd ..
# ./main
  • 测试
# cd test
# go test -v request_test.go gin-api.go
  • 平滑重启
# ps -ef |grep main
root      9142     1  1 13:26 ?        00:00:03 ./main
root      9667 21410  0 13:29 pts/0    00:00:00 grep main

# kill -USR2 9142

# ps -ef |grep main
root      9668     1 99 13:29 ?        00:00:02 ./main -graceful
root      9682 21410  0 13:29 pts/0    00:00:00 grep main

# go test -v request_test.go gin-api.go 

待做事项

  • 性能优化
  • 全链路监控
  • docker

About

Go语言开发的 gin api 服务,包含 golang gin 完整的模块代码和Gin-API系列文章。

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages