Giter VIP home page Giter VIP logo

micro's Introduction

micro

基于asim/go-micro微服务框架(Thanks asim)

进一步封装了一些功能组件,包括对应的示例

  • 实现了如下基础服务:

    • 服务治理,

      • 服务限流
      • 服务注册发现
      • 重试,降级,熔断
        • 基于hystrix
    • 链路追踪

      • 基于jaeger
      • 同步/异步
    • 配置中心

      • viper
        • 基于etcd远程配置
        • 动态更新配置
    • 同步服务

      • 客户端
      • 服务端
    • 异步服务

      • 事件/订阅
    • 对应示例

      • 同步服务
      • 异步服务
      • 多服务互相调用
  • env

// 开发模式
DEBUG=0 // 使用生产环境配置
DEBUG=1 // 使用开发环境配置(默认)

// 限流设置QPS
QPS=100

// 注册中心地址(etcd)
REGISTRY_ADDR=127.0.0.1:2379
REGISTRY_USER=root
REGISTRY_PASS=123456

// Jaeger Agent地址(6831端口)
TRACE_ADDR=127.0.0.1:6831
  • 快速运行

    • 安装依赖包
    go mod tidy
    
    • 运行网关
    sh shell/api.sh
    
    • 运行示例服务
      • 同步服务:sing、speak、listen
        • sing 调用 speak
        • sing 调用 listen
      • 异步服务:async_event、async_subscriber
        • async_event 创建事件
        • async_subscriber 创建订阅
    sh shell/example.sh
    
    • 具体路由查看网关定义
    文件地址:examples/api/api.go
    

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.