misc: Rename mgmtmain to lib and remove global package

This refactor should make it cleaner to use mgmt.
This commit is contained in:
James Shubin
2016-12-08 23:00:53 -05:00
parent 1f415db44f
commit 4803be1987
24 changed files with 202 additions and 157 deletions

View File

@@ -40,6 +40,10 @@ const (
graphStatePaused
)
type Flags struct {
Debug bool
}
// Graph is the graph structure in this library.
// The graph abstract data type (ADT) is defined as follows:
// * the directed graph arrows point from left to right ( -> )
@@ -49,6 +53,7 @@ const (
type Graph struct {
Name string
Adjacency map[*Vertex]map[*Vertex]*Edge // *Vertex -> *Vertex (edge)
Flags Flags
state graphState
mutex sync.Mutex // used when modifying graph State variable
}
@@ -105,6 +110,7 @@ func (g *Graph) Copy() *Graph {
newGraph := &Graph{
Name: g.Name,
Adjacency: make(map[*Vertex]map[*Vertex]*Edge, len(g.Adjacency)),
Flags: g.Flags,
state: g.state,
}
for k, v := range g.Adjacency {