Users have consistently found that the most effective way to learn Go kit is to study and learn from example services. Here you can find some examples that will orient you to Go kit idioms, patterns, and best practices.

  • stringsvc is a tutorial that takes you through writing a service from first principles. It can help you understand the decisions that went into Go kit’s design.
  • addsvc is the original example service. It exposes a set of operations over all supported transports. It’s fully logged, instrumented, and uses distributed tracing. It also demonstrates how to create and use client packages. It demonstrates almost all of Go kit’s features.
  • profilesvc demonstrates how to use Go kit to write a microservice with a REST-ish API. It uses net/http and the excellent Gorilla web toolkit.
  • shipping is a complete, “real-world” application composed of multiple microservices, based on Domain Driven Design principles.
  • apigateway demonstrates how to implement the API gateway pattern backed by a Consul service discovery system.

用户一直可以找到最有效的方法去学习go-kit和学习示例服务。在这里,您可以找到一些示例来指导您使用工具包习惯用法、模式和最佳实践。

  • stringsvc 这个教程,指导您从第一原则开始编写服务。它可以帮助您了解决策Go-kit的设计。

  • addsvc 是最初级的示例服务。它用所有支持的传输上公开一组操作。它完全记录、检测并使用分布式跟踪。它还演示了如何创建和使用客户机。它展示了Go-kit的几乎所有特性。

  • profilesvc演示如何使用Go-kit编写带有REST-ish API的微服务。它使用net/http和优秀的Gorilla web工具包

  • shipping 是一个完整的“现实世界”应用程序,由多个微服务组成,基于领域驱动的设计原则。

  • apigateway 演示如何实现由领域服务发现系统支持的API网关模式。

最后编辑: Simon  文档更新时间: 2021-02-04 15:45   作者:Simon