Flush will create the graph and clear it
()
| 80 | |
| 81 | // Flush will create the graph and clear it |
| 82 | func (g *Graph) Flush() (*QueryResult, error) { |
| 83 | res, err := g.Commit() |
| 84 | if err == nil { |
| 85 | g.Nodes = make(map[string]*Node) |
| 86 | g.Edges = make([]*Edge, 0) |
| 87 | } |
| 88 | return res, err |
| 89 | } |
| 90 | |
| 91 | // Commit creates the entire graph, but will re-add nodes if called again. |
| 92 | func (g *Graph) Commit() (*QueryResult, error) { |