$ show douyu/jupiter
Jupiter is a governance-oriented microservice framework for Go, developed and used at Douyu. It provides a comprehensive set of components for building production-grade microservices, including multiple HTTP server wrappers (Gin, Echo, fasthttp, GoFrame), gRPC server and client, service discovery via etcd, distributed task scheduling (XXL-JOB), caching (freecache, LRU), configuration management (file, etcd, Apollo, HTTP), structured logging with rotation, Prometheus metrics, OpenTelemetry tracing, and resilience patterns (Sentinel circuit breaker/flow control). The framework also includes a CLI tool for project scaffolding and protobuf code generation plugins for Gin, Echo, error codes, and field masks. The architecture follows a modular, pluggable design with consistent patterns for configuration (StdConfig/RawConfig/Build), lifecycle hooks, interceptor chains, and singleton management. It emphasizes observability and governance out of the box, with built-in health checks, pprof endpoints, and metric export. The codebase is well-structured with extensive unit and e2e tests, though it carries some technical debt from supporting multiple HTTP frameworks and legacy dependencies. While primarily an application framework, it includes reusable utility packages (retry, field mask, load balancing, goroutine management) that can be extracted independently. The framework is actively maintained with regular commits and CI/CD pipelines, but some dependencies are outdated and there is code duplication in log rotation and cache implementations.
The LLM identified 5 files worth highlighting for reuse:
A generic retry utility supporting configurable attempts, delay, exponential backoff with jitter, and context cancellation. It is self-contained (no internal imports beyond standard library) and can be extracted into any Go project for resilient operation retries.
Provides utilities for applying protobuf field masks to structs, including MaskIn and MaskOut operations. Uses generics for type safety and is independent of the rest of the framework. Useful for partial update APIs and selective data exposure.
Implements the Power of Two Choices (P2C) load balancing algorithm for gRPC client connections. Includes a picker builder, sub-connection tracking, and least-loaded selection. Can be reused as a custom gRPC balancer in any Go gRPC client.
A thread-safe singleton manager that stores instances by module name and key. Provides Get, Set, and MustGet methods. Used internally to reuse client connections and configs, but can be extracted for any Go application needing scoped singletons.
A utility for running multiple functions in parallel with error collection and context support. It manages goroutine lifecycle and returns all errors. Self-contained and useful for fan-out patterns in any Go project.