Configs2026年5月20日·1 分钟阅读

Go Micro — Distributed Microservices Framework for Go

Go Micro is a pluggable framework for building microservices in Go. It provides service discovery, RPC communication, event-driven messaging, and load balancing out of the box with a clean, idiomatic API.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Go Micro Overview
通用 CLI 安装命令
npx tokrepo install 9b315199-5403-11f1-9bc6-00163e2b0d79

Introduction

Go Micro provides a set of pluggable building blocks for writing microservices in Go. It abstracts away the details of distributed systems — service discovery, message encoding, RPC transport, and async messaging — letting developers focus on business logic rather than infrastructure plumbing.

What Go Micro Does

  • Abstracts service discovery with a Registry interface (Consul, etcd, mDNS, Kubernetes)
  • Provides synchronous RPC via a Transport layer and asynchronous messaging via a Broker
  • Includes built-in load balancing, retries, and timeouts for client calls
  • Generates service scaffolding with the micro CLI tool
  • Supports protocol buffers and gRPC as first-class transports

Architecture Overview

Go Micro is built around a set of interfaces: Registry for discovery, Transport for point-to-point communication, Broker for pub/sub, Codec for serialization, and Server/Client for the RPC layer. Each interface has multiple pluggable implementations, so you can swap Consul for etcd or gRPC for HTTP without changing application code. The framework uses a sidecar-free approach — all logic runs in-process.

Self-Hosting & Configuration

  • Install via go get go-micro.dev/v4 in any Go module
  • Configure service discovery backend via environment variables or code options
  • Use the built-in mDNS registry for local development without external dependencies
  • Deploy to Kubernetes using the built-in Kubernetes registry plugin
  • Set timeouts, retries, and connection pools through functional options

Key Features

  • Fully pluggable architecture — swap any component without code changes
  • Built-in service discovery, load balancing, and fault tolerance
  • Code generation from protobuf definitions for type-safe RPC
  • Event-driven architecture support through the Broker interface
  • Zero external dependency mode using mDNS for development

Comparison with Similar Tools

  • gRPC-Go — lower-level RPC framework; Go Micro adds discovery, load balancing, and a pluggable architecture on top
  • Go Kit — toolkit with explicit middleware composition; Go Micro offers a more opinionated, batteries-included approach
  • Dapr — sidecar-based runtime; Go Micro runs entirely in-process without sidecar overhead
  • Kratos — Bilibili's Go framework; Go Micro has a longer track record and larger plugin ecosystem

FAQ

Q: Is Go Micro still actively maintained? A: The project has transitioned through several maintainers. The v4 release is stable and used in production by many teams.

Q: Can I use Go Micro with gRPC? A: Yes. A gRPC transport plugin lets you use gRPC as the underlying communication layer.

Q: Does Go Micro require Consul or etcd? A: No. It ships with an mDNS-based registry for development, and supports Kubernetes, etcd, Consul, and others via plugins.

Q: How does Go Micro handle versioning and rolling deployments? A: Services register with version metadata. The client-side load balancer can route to specific versions using selector filters.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产