Documentation ¶
Index ¶
- func AddDependency(m DependencyContainer, v interface{})
- func AddInterfaceDependency(m DependencyContainer, v interface{})
- func GetDefaultInjectionID(v interface{}) string
- func GetDefaultInjectionIDByType(vt reflect.Type) string
- func GetInterfaceTypeAndValue(varRef interface{}) (interface{}, reflect.Type)
- func NameOfDependency(v interface{}) string
- func NameOfInterfaceDependency(v interface{}) string
- type DependencyContainer
- type DependencyInjector
- func (u DependencyInjector) Inject(varRef interface{}) error
- func (u DependencyInjector) InjectAll() error
- func (u DependencyInjector) InjectAny(varRef interface{}) error
- func (u DependencyInjector) InjectByID(id string, varRef interface{}) error
- func (u DependencyInjector) IsEmpty() bool
- func (u DependencyInjector) IsZero() bool
- func (u DependencyInjector) MustInject(varRef interface{})
- func (u DependencyInjector) MustInjectAll()
- func (u DependencyInjector) MustInjectAny(varRef interface{})
- func (u DependencyInjector) MustInjectByID(id string, varRef interface{})
- type DependencyOrigin
- type DependencyProviderFunc
- type DependencyRegistry
- type DependencyRegistryFunc
- type DependencyResolver
- func (p *DependencyResolver) CopyResolved() map[string]interface{}
- func (p *DependencyResolver) Count() int
- func (p *DependencyResolver) FindDependency(id string) (interface{}, bool)
- func (p *DependencyResolver) FindImplementation(t reflect.Type, checkAmbiguous bool) (interface{}, error)
- func (p *DependencyResolver) Flush() map[string]interface{}
- func (p *DependencyResolver) GetResolvedDependency(id string) (interface{}, bool)
- func (p *DependencyResolver) IsEmpty() bool
- func (p *DependencyResolver) IsZero() bool
- func (p *DependencyResolver) ResolveAndMerge(values map[string]interface{})
- func (p *DependencyResolver) ResolveAndReplace(overrides map[string]interface{})
- func (p *DependencyResolver) Target() interface{}
- type DynamicContainer
- func (m *DynamicContainer) AddDependency(v interface{})
- func (m *DynamicContainer) AddInterfaceDependency(v interface{})
- func (m *DynamicContainer) CopyAsStatic() StaticContainer
- func (m *DynamicContainer) DeleteDependency(id string)
- func (m *DynamicContainer) FindDependency(id string) (interface{}, bool)
- func (m *DynamicContainer) PutDependency(id string, v interface{})
- func (m *DynamicContainer) ReplaceDependency(v interface{})
- func (m *DynamicContainer) ReplaceInterfaceDependency(v interface{})
- func (m *DynamicContainer) ScanDependencies(fn func(id string, v interface{}) bool) (found bool)
- func (m *DynamicContainer) TryPutDependency(id string, v interface{}) bool
- type MultiMapRegistry
- type ScanDependencyRegistry
- type StaticContainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDependency ¶
func AddDependency(m DependencyContainer, v interface{})
func AddInterfaceDependency ¶
func AddInterfaceDependency(m DependencyContainer, v interface{})
func GetDefaultInjectionID ¶
func GetDefaultInjectionID(v interface{}) string
func NameOfDependency ¶
func NameOfDependency(v interface{}) string
func NameOfInterfaceDependency ¶
func NameOfInterfaceDependency(v interface{}) string
Types ¶
type DependencyContainer ¶
type DependencyContainer interface { DependencyRegistry PutDependency(id string, v interface{}) TryPutDependency(id string, v interface{}) bool }
type DependencyInjector ¶
type DependencyInjector struct {
// contains filtered or unexported fields
}
func NewDependencyInjector ¶
func NewDependencyInjector(target interface{}, globalParent DependencyRegistry, localParent DependencyRegistry) DependencyInjector
func NewDependencyInjectorFor ¶
func NewDependencyInjectorFor(resolver *DependencyResolver) DependencyInjector
func (DependencyInjector) Inject ¶
func (u DependencyInjector) Inject(varRef interface{}) error
func (DependencyInjector) InjectAll ¶
func (u DependencyInjector) InjectAll() error
func (DependencyInjector) InjectAny ¶
func (u DependencyInjector) InjectAny(varRef interface{}) error
func (DependencyInjector) InjectByID ¶
func (u DependencyInjector) InjectByID(id string, varRef interface{}) error
func (DependencyInjector) IsEmpty ¶
func (u DependencyInjector) IsEmpty() bool
func (DependencyInjector) IsZero ¶
func (u DependencyInjector) IsZero() bool
func (DependencyInjector) MustInject ¶
func (u DependencyInjector) MustInject(varRef interface{})
func (DependencyInjector) MustInjectAll ¶
func (u DependencyInjector) MustInjectAll()
func (DependencyInjector) MustInjectAny ¶
func (u DependencyInjector) MustInjectAny(varRef interface{})
func (DependencyInjector) MustInjectByID ¶
func (u DependencyInjector) MustInjectByID(id string, varRef interface{})
type DependencyOrigin ¶
type DependencyOrigin uint8
const ( DependencyFromLocal DependencyOrigin = 1 << iota DependencyFromProvider )
type DependencyProviderFunc ¶
type DependencyProviderFunc func(target interface{}, id string, resolveFn DependencyRegistryFunc) interface{}
type DependencyRegistry ¶
type DependencyRegistryFunc ¶
type DependencyResolver ¶
type DependencyResolver struct {
// contains filtered or unexported fields
}
func NewDependencyResolver ¶
func NewDependencyResolver(target interface{}, globalParent DependencyRegistry, localParent DependencyRegistry, onPutFn func(id string, v interface{}, from DependencyOrigin)) DependencyResolver
func (*DependencyResolver) CopyResolved ¶
func (p *DependencyResolver) CopyResolved() map[string]interface{}
func (*DependencyResolver) Count ¶
func (p *DependencyResolver) Count() int
func (*DependencyResolver) FindDependency ¶
func (p *DependencyResolver) FindDependency(id string) (interface{}, bool)
func (*DependencyResolver) FindImplementation ¶
func (p *DependencyResolver) FindImplementation(t reflect.Type, checkAmbiguous bool) (interface{}, error)
func (*DependencyResolver) Flush ¶
func (p *DependencyResolver) Flush() map[string]interface{}
func (*DependencyResolver) GetResolvedDependency ¶
func (p *DependencyResolver) GetResolvedDependency(id string) (interface{}, bool)
func (*DependencyResolver) IsEmpty ¶
func (p *DependencyResolver) IsEmpty() bool
func (*DependencyResolver) IsZero ¶
func (p *DependencyResolver) IsZero() bool
func (*DependencyResolver) ResolveAndMerge ¶
func (p *DependencyResolver) ResolveAndMerge(values map[string]interface{})
func (*DependencyResolver) ResolveAndReplace ¶
func (p *DependencyResolver) ResolveAndReplace(overrides map[string]interface{})
func (*DependencyResolver) Target ¶
func (p *DependencyResolver) Target() interface{}
type DynamicContainer ¶
type DynamicContainer struct {
// contains filtered or unexported fields
}
func NewDynamicContainer ¶
func NewDynamicContainer(parentRegistry DependencyRegistry) *DynamicContainer
func (*DynamicContainer) AddDependency ¶
func (m *DynamicContainer) AddDependency(v interface{})
func (*DynamicContainer) AddInterfaceDependency ¶
func (m *DynamicContainer) AddInterfaceDependency(v interface{})
func (*DynamicContainer) CopyAsStatic ¶
func (m *DynamicContainer) CopyAsStatic() StaticContainer
func (*DynamicContainer) DeleteDependency ¶
func (m *DynamicContainer) DeleteDependency(id string)
func (*DynamicContainer) FindDependency ¶
func (m *DynamicContainer) FindDependency(id string) (interface{}, bool)
func (*DynamicContainer) PutDependency ¶
func (m *DynamicContainer) PutDependency(id string, v interface{})
func (*DynamicContainer) ReplaceDependency ¶
func (m *DynamicContainer) ReplaceDependency(v interface{})
func (*DynamicContainer) ReplaceInterfaceDependency ¶
func (m *DynamicContainer) ReplaceInterfaceDependency(v interface{})
func (*DynamicContainer) ScanDependencies ¶
func (m *DynamicContainer) ScanDependencies(fn func(id string, v interface{}) bool) (found bool)
func (*DynamicContainer) TryPutDependency ¶
func (m *DynamicContainer) TryPutDependency(id string, v interface{}) bool
type MultiMapRegistry ¶
type MultiMapRegistry struct {
// contains filtered or unexported fields
}
func NewMultiMapRegistry ¶
func NewMultiMapRegistry(maps []map[string]interface{}) MultiMapRegistry
func (MultiMapRegistry) FindDependency ¶
func (v MultiMapRegistry) FindDependency(id string) (interface{}, bool)
func (MultiMapRegistry) ScanDependencies ¶
func (v MultiMapRegistry) ScanDependencies(fn func(id string, v interface{}) bool) bool
type ScanDependencyRegistry ¶
type StaticContainer ¶
type StaticContainer struct {
// contains filtered or unexported fields
}
func NewStaticContainer ¶
func NewStaticContainer(parentRegistry DependencyRegistry, contentRegistry ScanDependencyRegistry) StaticContainer
func (StaticContainer) AsRegistry ¶
func (m StaticContainer) AsRegistry() DependencyRegistry
func (StaticContainer) FindDependency ¶
func (m StaticContainer) FindDependency(id string) (interface{}, bool)
func (StaticContainer) ScanDependencies ¶
func (m StaticContainer) ScanDependencies(fn func(id string, v interface{}) bool) (found bool)
Click to show internal directories.
Click to hide internal directories.