Egg Framework

Production-Ready Go Microservices Framework with One-Line Startup

0
Core Modules
0
Layered Architecture
0
% Test Coverage
go get go.eggybyte.com/@latest
Scroll to explore

Why Choose Egg?

One-Line Startup

Start a complete microservice with just servicex.Run(). Get integrated configuration, logging, database, and tracing out of the box.

Clean Architecture

Four-layer architecture with strict dependency rules. No circular imports, clear separation of concerns, and maintainable code.

Connect-RPC First

Built-in Connect-RPC support with automatic interceptor stack for timeouts, logging, metrics, and tracing.

Hot Configuration

Reload configuration from Kubernetes ConfigMaps without restarting your service. Debounced updates for stability.

Observability

Production-ready observability with OpenTelemetry integration, structured logging, Prometheus metrics, and health checks.

Type-Safe DI

Dependency injection container with compile-time type safety. Clean, testable, and maintainable service composition.

Egg vs Traditional Approach

See how Egg outperforms traditional Go microservice frameworks:

Development Speed

Egg Framework 95%
Traditional Approach 60%

One-line startup vs manual setup

Code Maintainability

Egg Framework 90%
Traditional Approach 65%

Layered architecture prevents circular deps

Observability Integration

Egg Framework 100%
Traditional Approach 40%

Built-in tracing, metrics, and logging

Configuration Management

Egg Framework 95%
Traditional Approach 50%

Hot reload with K8s ConfigMap support

Test Coverage

Egg Framework 80%
Traditional Approach 45%

Comprehensive testing across all modules

Zero Dependencies (Core)

Egg Framework 100%
Traditional Approach 0%

L0 core layer has zero external deps

Layered Architecture

Egg follows a strict layered architecture to prevent circular dependencies and ensure maintainability:

L4: Integration Layer

The highest-level orchestration - brings everything together

servicex

L3: Runtime & Communication Layer

Service lifecycle management and RPC communication

runtimex connectx clientx

L2: Capability Layer

Horizontal capabilities like configuration, observability, HTTP utilities

configx obsx httpx

L1: Foundation Layer

Structured logging based on log/slog

logx

L0: Core Layer

Zero external dependencies - pure abstractions

core/errors core/identity core/log

Quick Start

Get started with Egg in minutes:

1

Install

Get the latest version of Egg's integration layer:

bash
go get go.eggybyte.com/egg/servicex@latest
2

Write Code

Create your first microservice:

go
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
}
3

Run

Start your service:

bash
go run main.go

Module Overview

Egg provides 13 core modules organized in four layers:

servicex

One-line service startup with integrated configuration, logging, database, and tracing.

runtimex

Service lifecycle management with graceful shutdown and health checks.

connectx

Connect-RPC interceptor stack for timeouts, logging, metrics, and tracing.

clientx

Resilient HTTP client factory with retry, circuit breaker, and timeouts.

configx

Unified configuration with hot reloading from multiple sources.

obsx

OpenTelemetry provider for distributed tracing and metrics.

httpx

HTTP utilities for binding, validation, and security.

logx

Structured logging with logfmt, JSON, and console formats.

storex

GORM-based storage abstraction with health checks.