Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph[Schema any] struct { // contains filtered or unexported fields }
func (Graph[Schema]) References ¶
References returns the indexes of the schemas that the schema at index depends on.
func (Graph[Schema]) TopologicalSort ¶
TopologicalSort performs a topological sort on the graph. Returns (nil, true) if a cycle is detected in the graph. Otherwise, returns (orderedIndexes, false), where orderedIndexes is a slice of schema indexes sorted such that the index u comes after the index v for all dependencies (u, v), each of which is the relationship that the schema at the index v depends on the schema at the index u. Related description: https://en.wikipedia.org/wiki/Topological_sorting#Kahn's_algorithm
Click to show internal directories.
Click to hide internal directories.