Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrName = errors.New("object name duplicate") ErrNotFound = errors.New("inject object name not found") ErrSingletonConstructor = errors.New("bind function must only provide one option of Singleton or Contructor") ErrFactoryType = errors.New("factory type must be func()(Type,error)") ErrSingletonType = errors.New("singleton type must be struct ptr") ErrInjectObject = errors.New("inject object must be struct ptr") ErrInjectField = errors.New("inject object field must public and must be struct ptr or interface") ErrBindType = errors.New("bind type mismatch inject target field") ErrSliceType = errors.New("CreateAll expect slice ptr which elem type must be interface or struct ptr") ErrObjectPtr = errors.New("Create func expect struct ptr or interface") )
errors .
View Source
var Debug = false
Debug debug flag , open debug sdi4go will print debug message into console
Functions ¶
This section is empty.
Types ¶
type Injector ¶
type Injector interface { // bind named object creator Bind(name string, options ...Option) error // Create object with name Create(name string, objectPtr interface{}) error // inject object fields with tag `inject:"object name"` Inject(object interface{}) error // CreateAll create special type objects slice // this function will search all bind class which must the provide slice type CreateAll(objectSlice interface{}) error }
Injector the golang inject objects sdi4go factory
Click to show internal directories.
Click to hide internal directories.