Documentation ¶
Overview ¶
Package graph provides tool to detect circular dependencies and find all dependant nodes in graphs.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() *graph
Example (CircularDeps) ¶
package main import ( "fmt" "github.com/gontainer/gontainer-helpers/graph" ) func main() { g := graph.New() g.AddDep("company", "tech-team") g.AddDep("tech-team", "cto") g.AddDep("cto", "company") g.AddDep("cto", "ceo") g.AddDep("ceo", "company") fmt.Println(g.CircularDeps()) }
Output: [[company tech-team cto company] [company tech-team cto ceo company]]
Example (Deps) ¶
package main import ( "fmt" "github.com/gontainer/gontainer-helpers/graph" ) func main() { g := graph.New() g.AddDep("company", "tech-team") g.AddDep("tech-team", "cto") fmt.Println(g.Deps("company")) }
Output: [cto tech-team]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.