Documentation ¶
Overview ¶
Package instantiate implement InstantiateFactory
Index ¶
- Variables
- func NewInstantiateFactory(instanceMap cmap.ConcurrentMap, components []*factory.MetaData, ...) factory.InstantiateFactory
- type ScopedInstanceFactory
- func (f *ScopedInstanceFactory[T]) GetInstance(params ...interface{}) (finalInstance T, err error)
- func (f *ScopedInstanceFactory[T]) GetInstanceContainer(params ...interface{}) (instanceContainer factory.InstanceContainer, err error)
- func (f *ScopedInstanceFactory[T]) GetInstanceFromContainer(instanceContainer factory.InstanceContainer) (finalInstance T)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotInitialized InstantiateFactory is not initialized ErrNotInitialized = errors.New("[factory] InstantiateFactory is not initialized") // ErrInvalidObjectType invalid object type ErrInvalidObjectType = errors.New("[factory] invalid object type") )
Functions ¶
func NewInstantiateFactory ¶ added in v0.9.5
func NewInstantiateFactory(instanceMap cmap.ConcurrentMap, components []*factory.MetaData, defaultProperties cmap.ConcurrentMap) factory.InstantiateFactory
NewInstantiateFactory the constructor of instantiateFactory
Types ¶
type ScopedInstanceFactory ¶ added in v1.8.0
type ScopedInstanceFactory[T any] struct { }
ScopedInstanceFactory implements ScopedInstanceFactory
func (*ScopedInstanceFactory[T]) GetInstance ¶ added in v1.8.0
func (f *ScopedInstanceFactory[T]) GetInstance(params ...interface{}) (finalInstance T, err error)
GetInstance get instance container and get the target instance form the container
func (*ScopedInstanceFactory[T]) GetInstanceContainer ¶ added in v1.8.0
func (f *ScopedInstanceFactory[T]) GetInstanceContainer(params ...interface{}) (instanceContainer factory.InstanceContainer, err error)
GetInstanceContainer get the instance container
func (*ScopedInstanceFactory[T]) GetInstanceFromContainer ¶ added in v1.8.0
func (f *ScopedInstanceFactory[T]) GetInstanceFromContainer(instanceContainer factory.InstanceContainer) (finalInstance T)
GetInstanceFromContainer get instance from a giving instance container
Click to show internal directories.
Click to hide internal directories.