gin-boilerplate

The fastest way to deploy a restful api’s with Golang - Gin Framework with a structured starter project that defaults to PostgreSQL database and Redis as the session storage.

Github星跟踪图

alt tag

Build Status
Join the chat at https://gitter.im/Massad/gin-boilerplate

Welcome to Golang Gin boilerplate!

The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQL database and Redis as the session storage.

Configured with

  • go-gorp: Go Relational Persistence
  • RedisStore: Gin middleware for session management with multi-backend support (currently cookie, Redis).
  • Built-in CORS Middleware
  • Feature PostgreSQL 9.6 JSON queries
  • Unit test

Installation

$ go get github.com/Massad/gin-boilerplate
$ cd $GOPATH/src/github.com/Massad/gin-boilerplate
$ go get -t -v ./...

Sometimes you need to get this package manually

$ go get github.com/bmizerany/assert

You will find the database.sql in db/database.sql

And you can import the postgres database using this command:

$ psql -U postgres -h localhost < ./db/database.sql

Running Your Application

$ go run *.go

Building Your Application

$ go build -v
$ ./gin-boilerplate

Testing Your Application

$ go test -v ./tests/*

Import Postman Collection (API's)

You can import from this link. If you don't have Postman, check this link https://www.getpostman.com

Contribution

You are welcome to contribute to keep it up to date and always improving!

If you have any question or need help, drop a message at https://gitter.im/Massad/gin-boilerplate


License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

主要指标

概览
名称与所有者Massad/gin-boilerplate
主编程语言Go
编程语言Go (语言数: 5)
平台
许可证MIT License
所有者活动
创建于2016-04-04 09:00:43
推送于2025-05-12 04:50:46
最后一次提交2025-04-02 09:10:19
发布数7
最新版本名称v2.0 (发布于 )
第一版名称v0.01 (发布于 )
用户参与
星数1.1k
关注者数21
派生数198
提交数84
已启用问题?
问题数10
打开的问题数1
拉请求数12
打开的拉请求数2
关闭的拉请求数39
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?