danceable

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package danceable adapts github.com/danceable/container to the provider's backend-agnostic Container contract.

The underlying *container.Container returns its own concrete type from Scope and Derive, so it does not satisfy the contract directly. The adapter bridges that gap by re-wrapping the children it returns, keeping the whole scope tree behind the interface, and by translating the neutral bind/resolve options into danceable's own option types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter wraps a *container.Container so it satisfies contract.Container.

func New

func New(concrete *container.Container) *Adapter

New wraps the given concrete container so it satisfies the Container contract.

func (*Adapter) Bind

func (a *Adapter) Bind(receiver any, opts ...contract.BindOption) error

Bind registers a resolver, translating the neutral bind options into danceable's own.

func (*Adapter) Call

func (a *Adapter) Call(receiver any, opts ...contract.ResolveOption) error

Call invokes the receiver, injecting its arguments from the container.

func (*Adapter) Derive

func (a *Adapter) Derive() contract.Container

Derive creates a new anonymous child container that inherits the parent's bindings.

func (*Adapter) Fill

func (a *Adapter) Fill(receiver any, opts ...contract.ResolveOption) error

Fill populates the tagged fields of the receiver struct from the container.

func (*Adapter) Reset

func (a *Adapter) Reset()

Reset clears the underlying container's bindings.

func (*Adapter) Resolve

func (a *Adapter) Resolve(abstraction any, opts ...contract.ResolveOption) error

Resolve resolves an abstraction into the receiver pointer.

func (*Adapter) Scope

func (a *Adapter) Scope(name string) contract.Container

Scope creates a new named child container for managing scoped dependencies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL