Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 2, 2026·3 min de lecture

Go Kit — Microservice Toolkit for Go

A standard library for microservices in Go providing packages for service discovery, transport, logging, and circuit breaking.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Go Kit
Commande d'installation directe
npx -y tokrepo@latest install ee7bd869-75cd-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Go Kit is a collection of Go packages that help you build robust, reliable, and maintainable microservices. It fills the gap between the Go standard library and enterprise microservice requirements without forcing an opinionated framework.

What Go Kit Does

  • Provides transport-agnostic service abstractions for HTTP, gRPC, Thrift, and NATS
  • Includes circuit breaker, rate limiter, and retry patterns out of the box
  • Offers pluggable service discovery via Consul, etcd, ZooKeeper, and DNS SRV
  • Delivers structured logging and metrics interfaces with multiple backend adapters
  • Implements the endpoint middleware pattern for composable cross-cutting concerns

Architecture Overview

Go Kit follows a strict layered architecture: Transport, Endpoint, and Service. Your business logic lives in the Service layer as plain Go interfaces. Endpoints wrap service methods with middleware for logging, auth, and tracing. Transports encode and decode between wire formats and endpoints, keeping business code decoupled from infrastructure.

Self-Hosting & Configuration

  • Add Go Kit packages individually with no monolithic import required
  • Configure service discovery by choosing a registrar such as Consul or etcd
  • Wire up OpenTelemetry or Prometheus exporters through the metrics interfaces
  • Use the built-in HTTP or gRPC transports or write a custom transport adapter
  • Everything is composed programmatically in Go with no config files needed

Key Features

  • Composable middleware chain for logging, metrics, tracing, and auth
  • First-class support for both synchronous and streaming RPC
  • Interoperability with the Go standard library and no framework lock-in
  • Clean separation of concerns that scales from a single service to hundreds
  • Mature and stable API surface trusted in production at scale

Comparison with Similar Tools

  • Micro — more opinionated full-stack platform; Go Kit is a composable toolkit
  • Kratos — provides built-in code generation; Go Kit favors explicit wiring
  • gRPC-Go — transport-only; Go Kit adds service patterns on top of any transport
  • Gin / Echo — HTTP-only web frameworks; Go Kit is transport-agnostic
  • Dapr — sidecar runtime approach; Go Kit is an in-process library

FAQ

Q: Is Go Kit a framework or a library? A: A library. You compose the pieces you need without inheriting a base class or following a rigid structure.

Q: Can I use Go Kit with existing HTTP routers like Chi or Gorilla? A: Yes. The HTTP transport layer works alongside any standard net/http-compatible router.

Q: Does Go Kit support gRPC streaming? A: Yes. The grpc transport package supports both unary and streaming RPCs.

Q: Is Go Kit still actively maintained? A: The project is stable and receives maintenance updates. Its API surface is intentionally frozen for reliability.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires