Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/go-kratos/kratos/llms.txt

Use this file to discover all available pages before exploring further.

Kratos provides a comprehensive set of components for building production-ready microservices. Each component is designed to be modular, extensible, and follows Go best practices.

Core Components

Transport Layer

The transport layer provides abstractions for different communication protocols:
  • Transport - Base transport interface and abstractions
  • HTTP - HTTP server and client implementation
  • gRPC - gRPC server and client implementation

Application Infrastructure

  • Middleware - Middleware system for HTTP and gRPC
  • Config - Configuration management with multiple sources
  • Log - Structured logging system
  • Errors - Error handling with codes and metadata

Data Handling

  • Encoding - Content encoding/decoding (JSON, XML, YAML, Proto, Form)

Service Discovery

  • Registry - Service registration and discovery
  • Selector - Load balancing and service selection
  • Metadata - Request/response metadata handling

Design Principles

All Kratos components follow these principles:

Interface-Based

Components are defined by interfaces, making them easily testable and replaceable

Context-Aware

All operations accept context.Context for cancellation and metadata propagation

Extensible

Components can be extended through options pattern and middleware

Production-Ready

Built with reliability, observability, and performance in mind

Getting Started

Explore individual component documentation to learn about their interfaces, configuration options, and usage patterns.