SD

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

2829 stars 品質 72 トレンド 47MIT

⚙️ Go 1.18+ Genericsに基づく依存注入ツールキットです。

概要

このライブラリは依存性注入設計パターンを実装しています。素晴らしいuber/digパッケージの代替となる可能性があります。samber/doはGo 1.18+ジェネリックを使用し、型安全なAPIを提供します。 - samber/ro: Reactive Programming for Go: イベント駆動アプリケーション向けの宣言的かつコンポーズ可能なAPI- samber/lo: Go 1.18+ Genericsに基づくLodashスタイルのGoライブラリ- samber/mo: Go 1.18+ Genericsに基づくMonads(Option、Result、Either...) - samber/cc-skills-golang: Golang向けAIエージェントスキル 💖 スポンサー:DBOS - Go用耐久的なワークフローオーケストレーションライブラリ このようなユーティリティライブラリとしてはとても気に入っています。この名前はDIとGoの合計で、どのGoパッケージもこの名前を使っていません。

概要(AI 翻訳)

** ⚙️ Go 1.18+ Genericsに基づく依存性注入ツールキット。**

このライブラリは依存注入設計パターンを実装しています。素晴らしいuber/digパッケージに代わる可能性があります。samber/doはGo 1.18+ジェネリックを使用しているため、型安全なAPIを提供します。

関連項目:

  • samber/ro: Reactive Programming for Go:イベント駆動型アプリケーション向けの宣言型かつコンポーズ可能なAPI
  • samber/lo:Go 1.18+ジェネリックに基づくLodashスタイルのGoライブラリ
  • samber/mo:Go 1.18+ジェネリック(オプション、結果、いずれか…)に基づくモナド
  • samber/cc-skills-golang:Golang の AI エージェントスキル

💖 スポンサー:

DBOS - Go用の耐久性のあるワークフローオーケストレーションライブラリ


なぜこの名前なのか?

私はこのユーティリティライブラリに短い名前がとても気に入っています。この名前はDIと[Goの合計で、どのGoパッケージもこの名前を使っていません。

💡 特徴

  • ** 📒 サービス登録**
  • 型別レジスタ
  • 名前による登録
  • パッケージから複数のサービスを同時に登録する
  • ** 🪃 奉仕の召し出**
  • イージアローディング
  • レイジーローディング
  • 過渡負荷
  • タグベースの呼び出し
  • 循環依存性検出
  • ** 🧙 ♂️ サービスエイリアシング**
  • 暗黙的(structの提供、インターフェース呼び出し)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

do - Dependency Injection

⚙️ A dependency injection toolkit based on Go 1.18+ Generics.

This library implements the Dependency Injection design pattern. It may replace the fantastic uber/dig package. samber/do uses Go 1.18+ generics and therefore offers a type‑safe API.

See also:

  • samber/ro: Reactive Programming for Go: declarative and composable API for event-driven applications
  • samber/lo: A Lodash-style Go library based on Go 1.18+ Generics
  • samber/mo: Monads based on Go 1.18+ Generics (Option, Result, Either…)
  • samber/cc-skills-golang: AI Agent Skills for Golang


Why this name?

I love the short name for such a utility library. This name is the sum of DI and Go and no Go package uses this name.

💡 Features

  • 📒 Service registration
    • Register by type
    • Register by name
    • Register multiple services from a package at once
  • 🪃 Service invocation
    • Eager loading
    • Lazy loading
    • Transient loading
    • Tag-based invocation
    • Circular dependency detection
  • 🧙‍♂️ Service aliasing
    • Implicit (provide struct, invoke interface)
    • Explicit (provide struct, bind interface, invoke interface)
  • 🔁 Service lifecycle
    • Health check
    • Graceful unload (shutdown)
    • Dependency-aware parallel shutdown
    • Lifecycle hooks
  • 📦 Scope (a.k.a module) tree
    • Visibility control
    • Dependency grouping
  • 📤 Container
    • Dependency graph resolution and visualization
    • Default container
    • Container cloning
    • Service override
  • 🧪 Debugging & introspection
    • Explain APIs: scope tree and service dependencies
    • Web UI & HTTP middleware (std, Gin, Fiber, Echo, Chi)
  • 🌈 Lightweight, no dependencies
  • 🔅 No code generation
GitHub で README 全文を見る

推奨ツール

別のキーワードを試すか、フィルタを外してください。

インストール

npx skillfish add samber/do
MCP 初心者?mcpskill.org のガイドから始めましょう →