instantiate

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Package instantiate implement InstantiateFactory

Index

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

Jump to

Keyboard shortcuts

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