Components
go-zero ships a comprehensive set of production-ready components that you can drop into any service.
Resilience
Section titled “Resilience”- Circuit Breaker — Stop cascading failures
- Rate Limiter — Sliding-window rate limiter
- Period Limiter — Redis-based period rate limiter
- Token Limiter — Token-bucket rate limiter
- Load Shedding — Drop excess traffic under overload
- Timeout — Enforce per-request deadlines
Concurrency
Section titled “Concurrency”- fx — Functional stream processing
- MapReduce — Parallel map-reduce
- Limit — Concurrency limiting via syncx
Caching
Section titled “Caching”- Memory Cache — In-process LRU/TTL cache
- Redis Cache — Distributed cache with read-through
Logging
Section titled “Logging”- logx — Core structured logger
- logc — Context-aware logging
- Desensitization — Mask sensitive log fields
Observability
Section titled “Observability”- Metrics — Prometheus integration
- Tracing — OpenTelemetry distributed tracing
- Profiling — Runtime profiling