Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureValidFactory ¶
func EnsureValidFactory(item interface{}) error
EnsureValidFactory will return nil if a factory is valid and an error if the factory cannot be used.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is a set of values which, when called in the proper order, contain all the requirements as return values of other functions.
func NewResolver ¶
func NewResolver() *Resolver
NewResolver returns an empty resolve set which can be used for resolving function calls.
func (*Resolver) AddNode ¶
AddNode adds a function to an internal graph of dependencies. The resolution will be done when Resolve is called.
func (*Resolver) Resolve ¶
Resolve will walk the graph of constructor nodes, run the constructors in the order they need to be run, and return an injector with all the return values from these constructors. Any error returned by these constructors will be returned by Resolve if the constructor returns them and is non nil. Note that because this requires a topological sort every time this is run, it is recommended to not use this often. Additionally, all nodes must be added before this method is called.