awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
samber avatar

samber/do

0
View on GitHub↗
2,645 stars·104 forks·Go·mit·29 viewsdo.samber.dev↗

Do

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 system for coordinating graceful shutdowns by executing cleanup logic in the reverse order of initialization.

The system covers service registration and invocation through strategies such as lazy loading and conditional provisioning. It also provides operational observability via health status monitoring and service health verification to ensure dependencies are functioning correctly.

Features

  • Dependency Injection Providers - Provides a type-safe system for automatically injecting services and dependencies into Go structures.
  • Dependency Lifecycle Management - Controls the creation and destruction of dependencies as singletons, factories, or on-demand instances.
  • Service Lifecycle Managers - Manages the creation and release lifecycle of services, including singletons and lazy loading.
  • Hierarchical Containers - Organizes services into a tree of nested containers to isolate modules and manage inheritance.
  • Hierarchical Scopes - Implements a hierarchical service container allowing child scopes to inherit dependencies from ancestors.
  • Reverse-Order Teardown Protocols - Coordinates graceful shutdowns by executing cleanup logic in the exact reverse order of service initialization.
  • Automatic Constructor Injection - Automatically populates structure fields with required services by inferring types or using metadata tags.
  • Go DI Frameworks - Provides a dedicated dependency injection framework tailored for the Go programming language.
  • Component Service Scoping - Isolates service instances within a tree of nested scopes where children inherit from ancestors.
  • Interface-to-Implementation Bindings - Decouples service consumers from concrete types by binding abstract interfaces to specific implementation providers.
  • Dependency Injection Population - Automatically populates structure fields with required services by scanning metadata tags using the runtime reflection system.
  • Hierarchical Scopes - Provides a tree of nested service containers where child scopes inherit dependencies from their ancestors.
  • Type-Safe Binding Registries - Maintains a type-safe map of unique identifiers to factory functions or singletons for consistent service retrieval.
  • Conditional Service Provisioning - Supports registering dependencies only when specific conditions are met for flexible environment setups.
  • Lazy Initialization - Defers the instantiation of a dependency until it is first requested to reduce startup resource usage.
  • Service - Runs customizable sequences of functions during service startup and shutdown for setup and cleanup.
  • Reverse-Order Shutdowns - Executes cleanup logic for services in reverse initialization order to ensure safe resource release.
  • Dependency Cycle Detection - Identifies circular references within the service dependency graph to prevent infinite recursion during resolution.
  • Dependency Graph Visualizations - Provides tools to map and inspect relationships and invocation chains between services for architectural verification.
  • Startup Validation - Invokes service dependencies during initialization to detect missing services before the application starts.
  • Circular Dependency Resolution - Detects and prevents infinite recursive loops during the registration and resolution of service dependencies.
  • Lazy Loading - Defers the instantiation of dependencies until they are first requested to optimize startup time and memory.
  • Service Loading Strategies - Implements eager, lazy, and transient loading strategies to manage service lifetimes and retrieval.
  • Service Replacement Mechanisms - Allows swapping an existing service implementation with a different one during execution to facilitate testing.
  • Health Checks - Executes health check sequences to ensure all system dependencies are operational and functioning correctly.
  • Dependency Injection - DI framework based on generics.

Star history

Star history chart for samber/doStar history chart for samber/do

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does samber/do do?

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.

What are the main features of samber/do?

The main features of samber/do are: Dependency Injection Providers, Dependency Lifecycle Management, Service Lifecycle Managers, Hierarchical Containers, Hierarchical Scopes, Reverse-Order Teardown Protocols, Automatic Constructor Injection, Go DI Frameworks.

Which projects share features with samber/do?

Projects with overlapping indexed features include: uber-go/fx — Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model… microsoft/tsyringe — tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class… google/guice — Guice is a Java dependency injection framework and component container. It automates object wiring by mapping… rrousselgit/provider — Provider is a state management and dependency injection framework for Flutter. It simplifies the sharing of data… flutterando/modular — Modular is a framework for the Flutter ecosystem that provides a structured approach to application architecture… google/dagger — Dagger is a compile-time dependency injection framework for Java and Android applications. It automates the…

Projects sharing features with Do

These projects share indexed features with Do. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • uber-go/fxuber-go avatar

    uber-go/fx

    7,354View on GitHub↗

    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

    Goapp-frameworkdependency-injectionframework
    View on GitHub↗7,354
  • microsoft/tsyringemicrosoft avatar

    microsoft/tsyringe

    5,960View on GitHub↗

    tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class implementations from object creation by managing dependencies and object lifecycles using decorators and metadata. The framework features a hierarchical container system where child containers can maintain independent registration scopes and fall back to parent containers for dependency resolution. It provides a provider system that controls object longevity through singleton and transient instantiation rules. The system supports recursive constructor injection and handles circular

    TypeScriptcontainerdecoratorsdependency
    View on GitHub↗5,960
  • google/guicegoogle avatar

    google/guice

    12,734View on 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
    View on GitHub↗12,734
  • rrousselgit/providerrrousselGit avatar

    rrousselGit/provider

    5,258View on GitHub↗

    Provider is a state management and dependency injection framework for Flutter. It simplifies the sharing of data across a widget tree by using a system that manages the injection of objects and services with automated lifecycle and resource disposal. The framework distinguishes itself through reactive state containers that bridge asynchronous data from streams and futures directly into the component tree. It supports state derivation, allowing new objects to be constructed and synchronized based on values observed from multiple upstream providers. To maintain performance, it provides selectiv

    Dart
    View on GitHub↗5,258
  • Compare all 30 related projects→