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 ¶
- type Adapter
- func (a *Adapter) Bind(receiver any, opts ...contract.BindOption) error
- func (a *Adapter) Call(receiver any, opts ...contract.ResolveOption) error
- func (a *Adapter) Derive() contract.Container
- func (a *Adapter) Fill(receiver any, opts ...contract.ResolveOption) error
- func (a *Adapter) Reset()
- func (a *Adapter) Resolve(abstraction any, opts ...contract.ResolveOption) error
- func (a *Adapter) Scope(name string) contract.Container
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 (*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 ¶
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.