Giter Club home page Giter Club logo

go-micro-learn's Introduction

go-micro-learn

用golang实现微服务架构的学习案例。

目录结构

  1. consul下放了consul的源码包
  2. go\src下放了代码

gin目录结构

// gin 
Frame 
    - app
    - conf
    - middleward
    - models
    - routes
    - services
    - uitl
    - main.go
// app 目录
app 
    - api
        - v1
            - goods.go
        - v2
        - route.go
    - app.go

//conf目录
conf
    - config.ini
models
    - models.go
    - goods.go
services
    - goodsService.go
util
    - config.go

使用到的包

  1. ini: go get -u github.com/go-ini/ini
  2. gorm
    • go get -u gorm.io/gorm
    • go get -u gorm.io/driver/sqlite
  3. gin
    • go get -u github.com/gin-gonic/gin

开发流程

  1. 我们使用go mod方式初始化gin目录 (不在go path 目录下开发,使用mod模式)
    • go mod init module name

go-micro-learn's People

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.