Code Monkey home page Code Monkey logo

go-example's Introduction

go-micro-example

Build Status codecov GitHub license

这只是一个技术使用的示例项目

使用的技术

功能 描述
网关 traefik kong 可以使用插件实现限流,断路器,重试,认证,统计等
框架 go-micro(微服务) + echo(web框架)
配置 默认值->yaml->env
日志 可选插件(zap logors),集成了链路跟踪go-log
链路跟踪 OpenTracing Jaeger
监控 go-metrics
打包 bindata
编码 protoc-gen-micro
部署 docker docker-compose k8s
文档生成 swagger
其他 JWT

目录结构

.
├── api //restful接口
├── cinit //公共配置和初始化
├── cmd //服务入口
├── data //测试数据
├── deployments //部署目录,docker docker-compose k8s配置文件,自动化生成
├── go.mod //go1.11包管理
├── go.sum
├── internal //内部公共组件
├── LICENSE
├── Makefile 
├── README.md
├── scripts //makefile使用的脚本
├── srv //服务目录
└── third_party //第三方包目录

依赖安装

  • 安装 protoc protoc-gen-micro protoc-gen-go

安装说明

  • 安装docker和docker-compose

  • 安装bindata打包

安装说明

编译

make vendor 
make allbuild

本地docker-compose运行

make compose

请求

//登录,返回token在响应头中:Authorization
curl -X POST http://127.0.0.1:8888/common/v1/login -H 'Content-Type: application/json' -d '{"username":"xiaomeng01","password":"123456"}' -i  

查看效果

  1. 链路跟踪:http://127.0.0.1:16686 本地效果

  2. 监控:http://127.0.0.1:3000 本地效果 用户名:admin 密码:admin

go-example's People

Contributors

xiaomeng79 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.