Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServices ¶
func GetServices(from Container, defs ...Definition) error
GetServices handles multiple service retrieval request
Types ¶
type Container ¶
type Container interface {
cfg.Configurer
// OnAfterInit register function, that will be invoked after service
// initialization and before it will be cached and returned
OnAfterInit(func(name string, target interface{}) error)
// HasService returns true if service with provided name is declared
HasService(name string) bool
// GetService searches for service by name and writes it into target
GetService(name string, target interface{}) error
// Define defines new service with build function for it
Define(name string, build func(Container) (interface{}, error))
// MustGetService is alias for GetService, that panics on error
MustGetService(name string, target interface{})
}
Container represents dependency injection container
type Definition ¶
type Definition interface {
Name() string
Target() interface{}
}
Definition describes service request definition
Click to show internal directories.
Click to hide internal directories.