Coder Social home page Coder Social logo

go-sample's Introduction

Build Status Go Report Card Go Reference GitHub go.mod Go version GitHub tag (latest by date) license

go-sample

基于 ginapi 服务端脚手架。 gin 框架在 Web 开发中是相当受欢迎的,但是 gin 也是一个轻量级 Web 框架,并不能像其他语言比如 JavaSpring 框架具有丰富的生态和标准,在实际开发中需要自己设计和添加一些额外的能力,来完善应用.

本项目布局为传统的MVC模式,参考了行业流行框架,适用于大部分业务api服务端开发。

项目特性

  • 优雅停机实现,停机时清理资源;
  • 使用 go-env 定义项目配置文件;
  • 集成 gormMySQL 进行数据持久化;
  • 提供了部分 demo 实现,可以按照 demo 在项目中直接使用;
  • 整合 redis 换成,开箱即用,实现分布式缓存功能;
  • 整合 zap 日志组件,完善日志输出;
  • 集成 jwt 组件,提供 demo 代码,自定义授权失败成功等的响应格式,跟全局 api 响应格式统一;
  • 增加 md5, bcryptuuid 生成工具包;
  • 应用统一封装响应格式,参照行业内主流项目规范;
  • 项目全局错误码封装;
  • 添加 Makefile 文件,可以使用 make 命令进行编译,打包。

项目结构

├─config
├─controller
├─docs
├─global
├─middlewares
├─models
├─pkg
│  ├─consistenthash
│  ├─encrypt
│  ├─jwt
│  ├─lock
│  ├─response
│  ├─ulits
│  └─uuid
└─router

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.