Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProviderNotFound = errors.New("no provider found that satisfies interface")
ErrProviderNotFound indicates that a provider was not found for the interface
var ErrUnsupportedType = errors.New("unsupported type")
ErrUnsupportedType indicates that the type of arg/field is not a struct or an interface
Functions ¶
This section is empty.
Types ¶
type Builder ¶ added in v0.1.4
type Builder struct {
// contains filtered or unexported fields
}
Builder builds a slice of resources
func NewBuilder ¶ added in v0.1.4
func NewBuilder() *Builder
NewBuilder returns a new resource builder
type Invoker ¶
type Invoker struct {
// contains filtered or unexported fields
}
Invoker is a dependency injecting function invoker that calls a given function, providing it with all required args.
func New ¶
func New(providers ...interface{}) *Invoker
New returns a dependency injecting function invoker with the given set of providers.
func (*Invoker) AddProvider ¶
func (inv *Invoker) AddProvider(provider interface{})
AddProvider adds a provider to the set of providers
func (*Invoker) Invoke ¶
Invoke calls the given function, providing it with the required providers. Each of the interface arguments specified in the given function is injected with a provider that implements that interface. An error is returned if no suitable provider is found for any of the supplied arguments. Note: All of the arguments in the provided function must be interfaces.