gin api的脚手架

基于gin的api脚手架

0、支持指定配置文件启动
1、不破坏gin的原有特性,基本不影响原有gin的运行速度
2、wire负责管理依赖注入
3、集成常用组件gorm/zap/viper/go-redis等
4、方便集成第三放组件
5、可扩展解耦方便,只需要替换data层数据源即可(biz负责定义repo/usercase,data层负责实现repo)
6、输入输出结构体单独提到api文档方便管理,约定对应具体的service模块
说明:实际开发只需要在api目录定义输入输出结构体,router添加路由,internal目录分别实现service/biz/data层即可
(数据校验等原有gin的方法照旧使用即可)

├── api  // 定义输入/输出的结构体
│   ├── user //对应user模块
│       ├── user.go //user模块相关的结构体
│   └── order //对应order模块
│       └── order.go //user模块相关的结构体
├── cmd  // 应用入口文件
│   ├── main.go //入口文件
│   ├── wire.go //依赖注入文件
│   ├── wire_gen.go //wire生成
├── configs  // 定义配置文件
├── internal  // 应用业务代码
|       └── biz //定义repo接口,解耦data实现
|       └── conf 
|       └── data //repo的具体实现
|           └── model //实体
|           └── data.go //注册各种组件
|       └── pkg //供其它目录使用的包
|       └── service //业务入口,处理业务校验等
├── middleware  // 中间件
├── pkg  // 公共使用的包
├── pkg  // 路由定义文件
    ├── app.go //初始化gin.Engine
    ├── router.go //自定义用户路由
└── third_party //第三方类库
└── tool //公共函数目录
└── docs //说明文档目录
└── go.mod

待增加功能:错误处理、平滑启动、多服务端管理

Similar Resources

gin api blog

Gin项目 介绍 以下是基于gin开发的项目接口,将持续更新,有兴趣请star,本项目包含mysql,redis,elasticsearch,mongo,rabbitmq,kafka,jaeger,单机限流,分布式限流,sentry, jwt,请求参数验证,发送邮件,图片上传,httpclient用

Oct 14, 2022

前端使用Vue3、CompositionAPI、typescript、vite、element plus,后端使用Go + Gin + Gorm,实现的后端管理系统,支持菜单、页面按钮及后端API的权限管控。

前端使用Vue3、CompositionAPI、typescript、vite、element plus,后端使用Go + Gin + Gorm,实现的后端管理系统,支持菜单、页面按钮及后端API的权限管控。

本系统使用最新的 Vue3 及相关技术栈,实现了菜单及页面按钮的权限管控,基于 Casbin 实现了后端 API 接口的管控,不进行过度的封装,代码简洁易懂,方便二次开发及当成后端管理平台脚手架使用,数据库暂时仅支持 postgres 。 演示站点:http://fdevops.com:8088 文

Apr 1, 2022

A restful api's with Gin Framework with a structured project that defaults to PostgreSQL database

A restful api's with Gin Framework with a structured project that defaults to PostgreSQL database

Welcome to Golang Gin boilerplate v2 The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQ

Oct 15, 2021

Simple web app using Go and Gin framework

go-gin-app Simple web app using Go and Gin framework Golang 과 Gin 프레임워크를 사용한 간단한 웹 앱 How to get Started Install Gin and have Go installed on your syst

Oct 18, 2021

A barebones URL Shortener implementation in Go using Gin and MySQL. Also features a basic frontend.

URL Shortener in Go This is a barebones URL Shortener implementation in Go using the Gin web framework and MySQL. Also features a basic frontend. Loca

Dec 22, 2021

A fully functional Ecommerce API in GO GIN Framework and mongoDB with JWT Authentication

A fully functional Ecommerce API in GO GIN Framework and mongoDB  with JWT Authentication

Fully functional ECOMMERCE API USING GIN FRAMEWORK AND MONGODB -----Initial Release v2.30 ⚠️ Not tested the efficiency project structure Ecommerce 📁

Dec 11, 2022

Tutorial: Deploying a basic Gin app on Jekyo

Tutorial: Deploying a basic Gin app on Jekyo Demo app here Prerequisites Make sure you have NodeJS, npm and git installed. If it's your first time usi

Nov 1, 2021

Menggunakan gol ver 1.13.15 dan framework gin dan gorm

Menggunakan gol ver 1.13.15 dan framework gin dan gorm

Jul 11, 2022

Restful API example with using go and gin framework

simple device api Simple Device API is really simple and concise to show how easy to implement a Restful Service with using Golang. It uses gin framew

Nov 18, 2021
Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Nov 21, 2021
Gin-boilerplate - This repository contains boilerplate code of a REST service using Gin (golang) framework.

Boilerplate REST service using Gin web framework (golang) Introduction This repository contains a boilerplate REST API service using Gin web framework

Apr 28, 2022
Gin-easy-todo - golang 의 RESTful API 프레임워크 gin 을 활용해 아주 간단한 Todo 애플리케이션을 만들어보자.
Gin-easy-todo - golang 의 RESTful API 프레임워크 gin 을 활용해 아주 간단한 Todo 애플리케이션을 만들어보자.

목차 1. 요약 2. 목표 3. API 목록 4. 프로젝트 구조 5. 패키지 별 기능과 관계 6. 사전 작업 6.1. DB, Table 생성 6.2. 모듈 생성 6.3. 패키지 다운로드 7. Gin 작성 7.1. 데이터베이스 설정 7.2. 테이블, 스키마 정의 7.3.

Jan 2, 2022
Go-service-gin - Simple Web api application developed in Golang and Gin

Simple Web api application developed in Golang and Gin Initial Tutorial URL http

Jan 4, 2022
Go-gin-ddd-cqrs - Clean api rest with Go, Gin and GORM
Go-gin-ddd-cqrs - Clean api rest with Go, Gin and GORM

GOLANG API REST Clean api rest with Go, Gin and GORM. Clean Architecture with DD

Oct 21, 2022
Go-gin-mongo-api - A backend RESTful API built using golang, gin and mongoDB

go-gin-mongo-API This is a RESTful backend API which is developed using the gola

Jul 19, 2022
Gin-boilerplate - Gin boilerplate preconfigured with basic rest api features

Gin Boilerplate Build apis with gin faster with this template Features Validatio

Jun 24, 2022
:construction: Closed. A website and user system (Gin/Backbone).

A website and user system starter. Implemented with gin and Backbone. Gowall is port of Drywall Go Node.js Repository here Drywall Site Gowall Drywall

Jul 6, 2020
GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework
GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework

GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework, it features a simple organized directory structure for your next project with a pleasant development experience, made for developing modern APIs and microservices.

Dec 29, 2022
Example golang using gin framework everything you need, i create this tutorial special for beginner.

Golang Gin Framework Fundamental Example golang using gin framework everything you need, i create this tutorial special for beginner. Feature Containe

Dec 16, 2022