The introduction

  • Finally, after some time of polishing, 2.0 emerged to facilitate the learning of gin framework
  • Making portal
  • Like iron son to point a star

1. Support functions

  1. Support Swagger interface document generation
  2. JWT authentication is supported
  3. Support for ZAP logs
  4. Support viper configuration file parsing
  5. Support go1.6.0 GO: Embed feature, package includes static files
  6. Support GORM database components, support read and write separation, database master and slave
  7. Support web interface using the Light Year Admin template, vUE learning a little cost
  8. Supports RBAC permission control for multiple roles, using Casbin
  9. Subsequent support tools generate projects
  10. Support for hot compilation of Fresh

2. Online documentation

1. Use Gitbook to generate; 2. Use Github's Pages function to set; 3Copy the code

The document address

3. Updated directory architecture

├ ─ app core directory (project) | ├ ─ controller (controller) | ├ ─ middleware (middleware) | ├ ─ models (layer data structure) | ├ ─ request (request data layer, Define specific request structure and data validation) | ├ ─ request (layer data display definition structure) | ├ ─ services (service) ├ ─ config (configuration package) ├ ─ core (kernel) ├ ─ docs (swagger document directory) ├ ─ global ├─ Initialize ├─ Routes ├─static │ ├─ exercises │ exercises │ exercises │ exercises │ exercises │ exercises │ exercises │ exercises │ exercises │ exercises │ exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │ Exercises │Copy the code

4. Project pictures

5. Follow-up planning

  • Support command tools to generate model, Controller, Request, etc
  • The background supports operation logs
  • The background supports scheduled tasks
  • Support for configuration management (as configurable as possible)
  • Support the cache
  • , etc.

6. Series of articles

  • Serialized a Golang environment build
  • Serial II installation Gin
  • Serial three defines the directory structure
  • Serial four builds case API1
  • Serial five builds case API2
  • Serial six access Swagger interface document
  • Serial seven Log components
  • Serial eight gracefully restarts and stops
  • Serial Makefile build
  • Serial Cron timing mission
  • Serial build command line tools
  • Create a dedicated Cache(First Day)
  • Create your own Cache in 3 days (Second Day)
  • Create a dedicated Cache(Third Day)