Documentation
¶
Overview ¶
Package resolve turns a parsed graph into a topologically ordered build plan. Resolution is memoized, detects cycles, and reports missing or ambiguous providers with a full dependency path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plan ¶
type Plan struct {
Graph *model.Graph
Root *Step
// Steps are ordered so that every dependency precedes its dependents.
Steps []*Step
// contains filtered or unexported fields
}
Plan is the resolved build order for a graph.
func Build ¶
Build resolves g into a plan. lifecycle and contextType are the framework types that are always injectable; either may be nil. base is used to render source paths in diagnostics.
func (*Plan) HasCleanup ¶
HasCleanup reports whether any provider in the plan returns a cleanup function. Generated code only emits rollback logic when it might be needed.
type Step ¶
type Step struct {
Kind StepKind
Provider *model.Provider
// Type is the type this step produces.
Type types.Type
// Deps are the steps that must run before this one, in input order.
Deps []*Step
// Pos is the source position of the provider, if any.
Pos token.Position
}
Step is one node of an ordered build plan.
Click to show internal directories.
Click to hide internal directories.