package
module
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Feb 28, 2022
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 3
Opens a new window with list of known importers.
Documentation
¶
Package di provides a reflection based dependency injection toolkit.
type CleanUp func() error
CleanUp represents a clean up function.
Injector represents a dependency injector.
New creates a new injector.
Invoke runs the given function after instantiating its dependencies.
func (a *Injector) MustProvide(constructor interface{}, itype interface{}, singleton bool)
MustProvide is like Provide but panics if has error.
func (a *Injector) Provide(constructor interface{}, itype interface{}, singleton bool) error
Provide teaches the injector how to build values and expresses their dependencies.
Release frees up resources allocated for the injector.
Result represents a invoke result.
Scan copies the result into the values pointed at by vs.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.