Skip to content
Snippets Groups Projects
README_CN.md 6.46 KiB
Newer Older
zonghaishang's avatar
zonghaishang committed
# Apache Dubbo-go [English](./README.md) #

[![Build Status](https://travis-ci.org/apache/dubbo-go.svg?branch=master)](https://travis-ci.org/apache/dubbo-go)
[![codecov](https://codecov.io/gh/apache/dubbo-go/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/dubbo-go)
fangyincheng's avatar
fangyincheng committed
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/apache/dubbo-go?tab=doc)
alexstocks's avatar
alexstocks committed
[![Go Report Card](https://goreportcard.com/badge/github.com/apache/dubbo-go)](https://goreportcard.com/report/github.com/apache/dubbo-go)
![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)
zonghaishang's avatar
zonghaishang committed

---
Apache Dubbo Go 语言实现

## 证书 ##

Apache License, Version 2.0

## 发布日志 ##

wongoo's avatar
wongoo committed
[v1.4.0 - 2020年3月17日](https://github.com/apache/dubbo-go/releases/tag/v1.4.0)

alexstocks's avatar
alexstocks committed
[v1.3.0 - 2020年3月1日](https://github.com/apache/dubbo-go/releases/tag/v1.3.0)

[v1.2.0 - 2019年11月15日](https://github.com/apache/dubbo-go/releases/tag/v1.2.0)
zonghaishang's avatar
zonghaishang committed

vito.he's avatar
vito.he committed
[v1.1.0 - 2019年9月7日 捐献给Apache之后的第一次release](https://github.com/apache/dubbo-go/releases/tag/v1.1.0)

alexstocks's avatar
alexstocks committed
[v1.0.0 - 2019年5月29日 兼容dubbo v2.6.5 版本](https://github.com/apache/dubbo-go/releases/tag/v1.0.0)
vito.he's avatar
vito.he committed

zonghaishang's avatar
zonghaishang committed
## 工程架构 ##

基于dubbo的extension模块和分层的代码设计(包括 protocol layer, registry layer, cluster layer, config 等等)。我们的目标是:你可以对这些分层接口进行新的实现,并通过调用 extension 模块的“ extension.SetXXX ”方法来覆盖 dubbo-go [同 go-for-apache-dubbo ]的默认实现,以完成自己的特殊需求而无需修改源代码。同时,欢迎你为社区贡献有用的拓展实现。

![dubbo go extend](./doc/pic/arch/dubbo-go-ext.png)
zonghaishang's avatar
zonghaishang committed

关于详细设计请阅读 [code layered design](https://github.com/apache/dubbo-go/wiki/dubbo-go-V1.0-design)

## 功能列表 ##

实现列表:

AlexStocks's avatar
AlexStocks committed
- 角色端
    * Consumer
    * Provider
AlexStocks's avatar
AlexStocks committed

AlexStocks's avatar
AlexStocks committed
- 传输协议
    * HTTP
    * TCP

- 序列化协议
    * JsonRPC V2
    * Hessian V2
fangyincheng's avatar
fangyincheng committed

- 协议
    * Dubbo
    * Jsonrpc2.0
fangyincheng's avatar
fangyincheng committed
    * [gRPC](https://github.com/apache/dubbo-go/pull/311)
flycash's avatar
flycash committed
    * [RESTful](https://github.com/apache/dubbo-go/pull/352)
    
- 路由器
flycash's avatar
flycash committed
    * [Condition router](https://github.com/apache/dubbo-go/pull/294)
    * [Health check router](https://github.com/apache/dubbo-go/pull/389)
flycash's avatar
flycash committed
    
AlexStocks's avatar
AlexStocks committed
- 注册中心
    * ZooKeeper
    * [etcd v3](https://github.com/apache/dubbo-go/pull/148)
    * [nacos](https://github.com/apache/dubbo-go/pull/151)
    * [consul](https://github.com/apache/dubbo-go/pull/121)
flycash's avatar
flycash committed
    * [k8s](https://github.com/apache/dubbo-go/pull/400)
AlexStocks's avatar
AlexStocks committed

AlexStocks's avatar
AlexStocks committed
- 动态配置中心与服务治理配置器
    * Zookeeper
    * [apollo](https://github.com/apache/dubbo-go/pull/250)
flycash's avatar
flycash committed
    * [nacos](https://github.com/apache/dubbo-go/pull/357)
AlexStocks's avatar
AlexStocks committed

AlexStocks's avatar
AlexStocks committed
- 集群策略
    * Failover
    * [Failfast](https://github.com/apache/dubbo-go/pull/140)
    * [Failsafe/Failback](https://github.com/apache/dubbo-go/pull/136)
    * [Available](https://github.com/apache/dubbo-go/pull/155)
    * [Broadcast](https://github.com/apache/dubbo-go/pull/158)
    * [Forking](https://github.com/apache/dubbo-go/pull/161)
AlexStocks's avatar
AlexStocks committed

AlexStocks's avatar
AlexStocks committed
- 负载均衡策略
    * Random
    * [RoundRobin](https://github.com/apache/dubbo-go/pull/66)
    * [LeastActive](https://github.com/apache/dubbo-go/pull/65)
fangyincheng's avatar
fangyincheng committed
    * [ConsistentHash](https://github.com/apache/dubbo-go/pull/261)
AlexStocks's avatar
AlexStocks committed

AlexStocks's avatar
AlexStocks committed
- 过滤器
    * Echo Health Check
    * [服务熔断&降级](https://github.com/apache/dubbo-go/pull/133)
    * [TokenFilter](https://github.com/apache/dubbo-go/pull/202)
    * [AccessLogFilter](https://github.com/apache/dubbo-go/pull/214)
    * [TpsLimitFilter](https://github.com/apache/dubbo-go/pull/237)
    * [ExecuteLimitFilter](https://github.com/apache/dubbo-go/pull/246)
    * [Auth/Sign](https://github.com/apache/dubbo-go/pull/323)
    * [Metrics filter](https://github.com/apache/dubbo-go/pull/342)
    * [Tracing filter](https://github.com/apache/dubbo-go/pull/335)
AlexStocks's avatar
AlexStocks committed

AlexStocks's avatar
AlexStocks committed
- 调用
    * [泛化调用](https://github.com/apache/dubbo-go/pull/122)
flycash's avatar
flycash committed
    
- 监控
    * Opentracing API
    * [Prometheus](https://github.com/apache/dubbo-go/pull/342)

- Tracing
    * [For jsonrpc](https://github.com/apache/dubbo-go/pull/335)
    * [For dubbo](https://github.com/apache/dubbo-go/pull/344)
    * [For grpc](https://github.com/apache/dubbo-go/pull/397)
AlexStocks's avatar
AlexStocks committed
- 其他功能支持:
    * 启动时检查
    * 服务直连
    * 多服务协议
    * 多注册中心
    * 多服务版本
    * 服务分组
zonghaishang's avatar
zonghaishang committed

开发中列表:

vito.he's avatar
vito.he committed
- 元数据中心 (dubbo v2.7.x)
flycash's avatar
flycash committed
- 服务发现 (dubbo v2.7.x)
zonghaishang's avatar
zonghaishang committed

AlexStocks's avatar
AlexStocks committed
你可以通过访问 [roadmap](https://github.com/apache/dubbo-go/wiki/Roadmap) 知道更多关于 dubbo-go 的信息。
zonghaishang's avatar
zonghaishang committed

flycash's avatar
flycash committed
![feature](./doc/pic/arch/dubbo-go-arch.png)
vito.he's avatar
vito.he committed

fangyincheng's avatar
fangyincheng committed
## 文档

fangyincheng's avatar
fangyincheng committed
https://dubbogo.github.io/dubbo-go-website (**完善中**)
fangyincheng's avatar
fangyincheng committed

zonghaishang's avatar
zonghaishang committed
## 快速开始 ##

fangyincheng's avatar
fangyincheng committed
[dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples)这个项目的事例展示了如何使用 dubbo-go 。请仔细阅读 [dubbo-samples/golang/README.md](https://github.com/dubbogo/dubbo-samples/blob/master/golang/README.md) 学习如何处理配置并编译程序。
zonghaishang's avatar
zonghaishang committed

fangyincheng's avatar
fangyincheng committed
## 运行单测

### 准备

Mac/Linux
fangyincheng's avatar
fangyincheng committed
```bash
vito.he's avatar
vito.he committed
sh ./before_ut.sh
```

Windows
```bash
before_ut.bat
```

fangyincheng's avatar
fangyincheng committed
### 执行
fangyincheng's avatar
fangyincheng committed
```bash
go test ./...

# coverage
fangyincheng's avatar
fangyincheng committed
go test ./... -coverprofile=coverage.txt -covermode=atomic
```

fangyincheng's avatar
fangyincheng committed
## 编译

请移步 [dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples)

## 如何贡献

如果您愿意给 [Apache/dubbo-go](https://github.com/apache/dubbo-go) 贡献代码或者文档,我们都热烈欢迎。具体请参考 [contribution intro](https://github.com/apache/dubbo-go/blob/master/contributing.md)
zonghaishang's avatar
zonghaishang committed
## 性能测试 ##

AlexStocks's avatar
AlexStocks committed
性能测试项目是 [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark)
zonghaishang's avatar
zonghaishang committed

AlexStocks's avatar
AlexStocks committed
关于 dubbo-go 性能测试报告,请阅读 [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-jsonrpc)
zonghaishang's avatar
zonghaishang committed

## [User List](https://github.com/apache/dubbo-go/issues/2)

yuyu's avatar
yuyu committed
若你正在使用 [apache/dubbo-go](github.com/apache/dubbo-go) 且认为其有用或者向对其做改进,请忝列贵司信息于 [用户列表](https://github.com/apache/dubbo-go/issues/2),以便我们知晓之。

zonghaishang's avatar
zonghaishang committed
![ctrip](https://pic.c-ctrip.com/common/c_logo2013.png)
fangyincheng's avatar
fangyincheng committed
![Excellent Health Technology Group](https://raw.githubusercontent.com/dajiiu/photo/static/mirror/haozhuo_logo.png)
fangyincheng's avatar
fangyincheng committed
![tuya](https://raw.githubusercontent.com/pantianying/go-tool/master/picture/logo_2-removebg-preview.png)