Documentation
¶
Index ¶
- func Clear()
- func Get(ctn interface{}, key string) interface{}
- func Inject(ctn interface{}, objs ...interface{})
- func NewContext(ctx context.Context, container Container) context.Context
- func Register(def Definition)
- func SafeInject(ctn interface{}, objs ...interface{})
- func Set(key string, value interface{})
- type Container
- type Definition
- type DepsInjector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a new Context, derived from ctx, which carries the provided Container.
func Register ¶
func Register(def Definition)
Register the provided Definition to be available when building the DI container.
func SafeInject ¶
func SafeInject(ctn interface{}, objs ...interface{})
Types ¶
type Container ¶
type Container = di.Container
func FromContext ¶
FromContext returns a Container from ctx or panic if no Container is found.
type Definition ¶
type Definition = di.Def
type DepsInjector ¶
type DepsInjector interface {
InjectDeps(ctn Container)
}
Click to show internal directories.
Click to hide internal directories.