Egg Framework
Production-Ready Go Microservices Framework with One-Line Startup
Start a complete microservice with just servicex.Run(). Get integrated configuration, logging, database, and tracing out of the box.
Four-layer architecture with strict dependency rules. No circular imports, clear separation of concerns, and maintainable code.
Built-in Connect-RPC support with automatic interceptor stack for timeouts, logging, metrics, and tracing.
Reload configuration from Kubernetes ConfigMaps without restarting your service. Debounced updates for stability.
Production-ready observability with OpenTelemetry integration, structured logging, Prometheus metrics, and health checks.
Dependency injection container with compile-time type safety. Clean, testable, and maintainable service composition.
See how Egg outperforms traditional Go microservice frameworks:
One-line startup vs manual setup
Layered architecture prevents circular deps
Built-in tracing, metrics, and logging
Hot reload with K8s ConfigMap support
Comprehensive testing across all modules
L0 core layer has zero external deps
Egg follows a strict layered architecture to prevent circular dependencies and ensure maintainability:
The highest-level orchestration - brings everything together
Service lifecycle management and RPC communication
Horizontal capabilities like configuration, observability, HTTP utilities
Structured logging based on log/slog
Zero external dependencies - pure abstractions
Get started with Egg in minutes:
Get the latest version of Egg's integration layer:
go get go.eggybyte.com/egg/servicex@latest
Create your first microservice:
package main
import (
"context"
"go.eggybyte.com/egg/servicex"
)
func main() {
ctx := context.Background()
servicex.Run(ctx,
servicex.WithService("my-service", "1.0.0"),
servicex.WithRegister(register),
)
}
func register(app *servicex.App) error {
// Register your handlers here
return nil
}
Start your service:
go run main.go
Egg provides 13 core modules organized in four layers:
One-line service startup with integrated configuration, logging, database, and tracing.
Service lifecycle management with graceful shutdown and health checks.
Connect-RPC interceptor stack for timeouts, logging, metrics, and tracing.
Resilient HTTP client factory with retry, circuit breaker, and timeouts.
Unified configuration with hot reloading from multiple sources.
OpenTelemetry provider for distributed tracing and metrics.
HTTP utilities for binding, validation, and security.
Structured logging with logfmt, JSON, and console formats.
GORM-based storage abstraction with health checks.