Giter Site home page Giter Site logo

gallop's Introduction

Gallop

Go gin 快速开发脚手架,本仓库的实现思路和部分代码多数来源于https://github.com/shenyisyn/goft-gin

Gallop主要是使用inject去贯彻,这个项目并实现mvc架构,对gin进行封装

使用到的开源库,排名不分先后

  1. gin-gonic/gin https://gin-gonic.com/docs/
  2. spf13/viper https://github.com/spf13/viper
  3. facebookarchive/inject https://github.com/facebookarchive/inject
  4. jinzhu/copier https://github.com/jinzhu/copier.git

系统配置说明

1.集成了日志zap组件,会以json对象输出

logger:
    type: file
    path: ./logs
    level: debug # 支持debug< info< warn< error< dpanic< panic< fatal
    stack: false # 当设置为true只有>=warn的等级才会显示stack

为了方便继承,我们增加了LogFiled属性,用户自定义日志输出如增加req_id

filed:=logger.LogField{}
filed["req_id"]="xxxxxxxxxxxxx"
logger.Info("1233",filed)
//输出: {"level":"INFO","ts":"2020-08-28 14:26:32","func":"controller/hello.go:20","msg":"1233","req_id":"xxxxxxxxxxxxx"}

gallop's People

Contributors

larryclean avatar realjustice avatar

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.