Documentation
¶
Index ¶
- Variables
- type BeanOptions
- type BeanType
- type Container
- func (container *Container) Get(name string) (interface{}, error)
- func (container *Container) GetAll(name string) ([]interface{}, error)
- func (container *Container) Register(factories ...interface{}) error
- func (container *Container) RegisterCompose(registrars ...Registrar) error
- func (container *Container) RegisterOne(factory interface{}) error
- type InStruct
- type Registrar
Constants ¶
This section is empty.
Variables ¶
View Source
var BeanOptionsType = reflect.TypeOf(&BeanOptions{})
BeanOptionsType reflect type of BeanOptions
View Source
var ErrorInterface = reflect.TypeOf((*error)(nil)).Elem()
ErrorInterface interface of error
View Source
var InStructType = reflect.TypeOf(InStruct{})
InStructType reflect type of BeanOptions
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container simple DI container
func NewContainer ¶
NewContainer create new DI container and register dependencies
func NewContainerWithLogger ¶
NewContainerWithLogger create new DI container with custom logger and register dependencies
func NewContainerWithLogging ¶ added in v0.0.2
NewContainerWithLogging create new DI container with default logger
func (*Container) GetAll ¶
GetAll return beans from all registered by name (interface name) factories
func (*Container) RegisterCompose ¶
RegisterCompose run all registrars
func (*Container) RegisterOne ¶
RegisterOne add bean factory to DI container
Click to show internal directories.
Click to hide internal directories.