Documentation ¶
Overview ¶
Author: Daniel TAN Date: 2021-08-18 23:32:00 LastEditors: Daniel TAN LastEditTime: 2021-12-17 23:50:47 FilePath: /trinity-micro/core/ioc/container/consts.go Description:
Author: Daniel TAN Date: 2021-08-18 23:32:00 LastEditors: Daniel TAN LastEditTime: 2021-12-18 00:02:05 FilePath: /trinity-micro/core/ioc/container/util.go Description:
Index ¶
- Constants
- type Config
- type Container
- func (s *Container) CheckInstanceNameIfExist(instanceName string) bool
- func (s *Container) DiAllFields(dest interface{}, injectingMap map[string]interface{})
- func (s *Container) DiFree(dest interface{})
- func (s *Container) DiSelfCheck(instanceName string) error
- func (s *Container) GetInstance(instanceName string, injectingMap map[string]interface{}) interface{}
- func (s *Container) InstanceDISelfCheck() error
- func (s *Container) RegisterInstance(instanceName string, instancePool *sync.Pool)
- func (s *Container) Release(instanceName string, instance interface{})
- type Keyword
Constants ¶
const ( TAG_SPLITER = ";" TAG_KV_SPLITER = ":" CONTEXT = "CONTEXT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
NewContainer get the new container instance if not passing the config , will init with the default config
func (*Container) CheckInstanceNameIfExist ¶
CheckInstanceNameIfExist check instance name if exist if exist , return true if not exist , return false
func (*Container) DiAllFields ¶
func (*Container) DiSelfCheck ¶
DiSelfCheck check if the registered instance is invalid
func (*Container) GetInstance ¶
func (s *Container) GetInstance(instanceName string, injectingMap map[string]interface{}) interface{}
InstanceDISelfCheck get instance by instance name injectingMap , the dependency instance, will inject the instance in injectingMap as priority
func (*Container) InstanceDISelfCheck ¶
InstanceDISelfCheck self check all the instance registered exist or not
func (*Container) RegisterInstance ¶
RegisterInstance register new instance if instanceName is empty will fatal if instancePool is invalid , will fatal