awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
uber-go avatar

uber-go/fx

0
View on GitHub↗
7,354 星标·330 分支·Go·mit·15 次浏览uber-go.github.io/fx↗

Fx

Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model container that automates the instantiation and connection of components by analyzing constructor parameters and return values to resolve complex dependency graphs.

The framework distinguishes itself through module-based component bundling, which encapsulates related constructors into reusable units to manage visibility and logic. It provides advanced resolution capabilities, including mapping concrete types to interfaces for decoupling, resolving dependency ambiguities via unique naming, and aggregating multiple instances of the same type into named or typed groups.

Beyond dependency resolution, the system orchestrates the startup and shutdown sequences of singletons and background processes. It handles the bootstrapping of interlocking dependencies and provides mechanisms for blocking execution until stop signals trigger cleanup operations.

The project includes integration for custom logging to capture and format internal operational events of the dependency system.

Features

  • Automatic Constructor Injection - Automatically provides dependencies into constructors by analyzing function signatures.
  • Go DI Frameworks - Provides a full-featured dependency injection framework for Go that automates component wiring via constructors.
  • Lifecycle Sequence Orchestration - Orchestrates startup and shutdown sequences by executing hooks in the order of dependency resolution.
  • Dependency Injection Containers - Functions as a container that manages the instantiation and lifecycle of components to achieve loose coupling.
  • Go DI Frameworks - Provides a framework that automates component connection by analyzing constructor parameters and return values.
  • Application Bootstrapping - Automates the instantiation of interlocking dependencies to remove global state from the application startup process.
  • Application Lifecycle Management - Coordinates the precise startup and shutdown sequences of services to ensure correct resource initialization and cleanup.
  • Application Component Lifecycles - Provides a mechanism to manage the startup and shutdown sequences of application components to ensure correct resource ordering.
  • Dependency Injection - Provides required dependencies automatically to decouple implementation from instantiation.
  • Dependency Injection Containers - Implements a dependency injection container that resolves shared application state and maps concrete types to interfaces.
  • Dependency Injection - Maps concrete return types to interfaces so consumers remain decoupled from specific implementations.
  • Interface-to-Implementation Bindings - Maps concrete return types to interfaces to allow flexible implementation swapping.
  • DI Module Bundling - Encapsulates related constructors into modules to manage visibility and reuse across services.
  • Reflection-Based Dependency Resolution - Uses runtime type analysis to match requested dependencies with available providers.
  • Component Bundles - Provides the ability to group related constructors and logic into modules for simplified application assembly.
  • Execution Blocking - Blocks application execution until a stop signal triggers necessary cleanup operations.
  • Reusable DI Modules - Enables the creation of reusable component modules that can be integrated across different services.
  • Dependency Graph Pruning - Instantiates only the components necessary to satisfy the requirements of the root application process.
  • Group Value Injection - Assigns a typed result to a named collection so multiple components contribute values to a shared group.
  • Named Group Injection - Retrieves a collection of components of the same type by a named group to receive all registered instances.
  • Type-Based Group Injection - Collects multiple components of the same type into a slice and injects them as a group.
  • Modular Software Design - Organizes code into decoupled, reusable modules that bundle constructors and logic for better maintainability.
  • Module Encapsulation Patterns - Implements patterns for controlling constructor visibility and encapsulating internal implementation details within modules.
  • Named Dependency Groups - Aggregates multiple instances of the same type into slices using unique group identifiers.
  • Named Dependency Resolution - Assigns unique names to multiple instances of the same type to ensure the correct implementation is injected.
  • Application Entry Point Triggering - Executes root-level functions to start background workers or servers.
  • Dependency Injection - Application framework built on top of dependency injection.
  • Frameworks and Libraries - A dependency injection-based application framework.

Star 历史

uber-go/fx 的 Star 历史图表uber-go/fx 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Fx 的开源替代方案

相似的开源项目,按与 Fx 的功能重合度排序。
  • google/guicegoogle 的头像

    google/guice

    12,734在 GitHub 上查看↗

    Guice is a Java dependency injection framework and component container. It automates object wiring by mapping interfaces to implementations via a central injector, removing the need for manual factory patterns and constructor calls. The framework provides specialized support for aspect-oriented programming, allowing for the interception and modification of method execution to implement shared cross-cutting concerns. It also functions as a persistence manager to coordinate transaction boundaries and manage the lifecycle of entity managers within a dependency-injected environment. Its core cap

    Java
    在 GitHub 上查看↗12,734
  • facebookarchive/injectfacebookarchive 的头像

    facebookarchive/inject

    1,408在 GitHub 上查看↗

    Inject is a dependency injection framework for Go that automates the assembly of complex object graphs. By leveraging runtime reflection, the library dynamically inspects object structures to resolve and populate required dependencies, decoupling component initialization from business logic. The framework manages object lifecycles through both singleton and factory-based provisioning. It maintains a central registry to share singletons across an application for consistent state, while also supporting the creation of unique, private instances to isolate state between different components. To

    Go
    在 GitHub 上查看↗1,408
  • uber-go/diguber-go 的头像

    uber-go/dig

    4,470在 GitHub 上查看↗

    dig is a reflection-based dependency injection framework and object graph resolver for Go. It functions as a container that automatically satisfies type dependencies and manages the instantiation of complex networks of objects during application startup. The project utilizes a directed acyclic graph to determine the necessary sequence for object instantiation and employs interface-driven provider mapping to decouple concrete implementations from their satisfied interfaces. It resolves the object hierarchy through reflection-based type resolution and single-pass component wiring to ensure all

    Godependency-injectiondigo
    在 GitHub 上查看↗4,470
  • samber/dosamber 的头像

    samber/do

    2,645在 GitHub 上查看↗

    This project is a type-safe dependency injection framework for Go that manages application lifecycles and injects dependencies into structures using reflection and metadata tags. It functions as a service lifecycle manager and an interface binding library to decouple service consumption from concrete implementations. The framework utilizes a hierarchical service container, organizing services into a tree of nested scopes where child containers inherit dependencies from their ancestors. It includes a dependency graph visualizer for inspecting relationships and invocation chains, as well as a s

    Gocontainerdependencydependency-graph
    在 GitHub 上查看↗2,645
查看 Fx 的所有 30 个替代方案→

常见问题解答

uber-go/fx 是做什么的?

Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model container that automates the instantiation and connection of components by analyzing constructor parameters and return values to resolve complex dependency graphs.

uber-go/fx 的主要功能有哪些?

uber-go/fx 的主要功能包括:Automatic Constructor Injection, Go DI Frameworks, Lifecycle Sequence Orchestration, Dependency Injection Containers, Application Bootstrapping, Application Lifecycle Management, Application Component Lifecycles, Dependency Injection。

uber-go/fx 有哪些开源替代品?

uber-go/fx 的开源替代品包括: google/guice — Guice is a Java dependency injection framework and component container. It automates object wiring by mapping… facebookarchive/inject — Inject is a dependency injection framework for Go that automates the assembly of complex object graphs. By leveraging… uber-go/dig — dig is a reflection-based dependency injection framework and object graph resolver for Go. It functions as a container… samber/do — This project is a type-safe dependency injection framework for Go that manages application lifecycles and injects… dodyg/practical-aspnetcore — This project is a comprehensive sample library and implementation guide for ASP.NET Core. It provides a collection of… square/dagger — Dagger is a compile-time dependency injection framework for Java and Android that automates object creation and…