-
Use go-kit where you want complete control. Use go-micro where you want an opinionated framework.
- Consul是GoMicro默认使用的服务发现系统,可以使用插件的方式进行修改。可以在 micro/go-plugins 查找etcd, kubernetes, zookeeper等系统的插件实现方式。
- Consul安装
-
使用方式
go run main.go --registry=mdns
- 程序例子在 examples/service.
Go Micro 包括支持了函数编程模型。
- 程序例子在 examples/function.
默认情况下面go-micro在核心部分对每个接口只提供了很少的一些实现,但是他们完全可以以插件的形式实现。
Go Micro以Wrappers实现中间件的概念。
-
程序例子在 service/wrapper
Micro是微服务开发工具集合,目的是简化分布式系统的开发工作。包括如下五个组成部分:
-
Go Micro - 开发包:插件式的RPC开发框架。
-
API - API网关:单一的Http协议入口,动态的将HTTP请求转换为RPC请求(HTTP请求)。
micro api --handler=rpc # 将HTTP请求转换为RPC请求 micro api # 默认的方式The default handler uses endpoint metadata from the registry to determine service routes micro api --handler=proxy # 使用github.com/micro/go-web,HTTP代理实现
-
Web - 提供了dashboard 查询服务的Web界面。
-
CLI - 跟你的微服务交互的命令行接口。
-
Bot - The micro bot is a bot that sits inside your microservices environment which you can interact with via Slack, HipChat, XMPP, etc. It mimics the functions of the CLI via messaging.