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 propagationExtensible
Components can be extended through options pattern and middleware
Production-Ready
Built with reliability, observability, and performance in mind