Documentation
¶
Index ¶
- type Edge
- type Graph
- func (g *Graph) AddEdge(e Edge) error
- func (g *Graph) AddNode(n Node) error
- func (g *Graph) Close() error
- func (g *Graph) GetStoredPath(start, end, kind string) (*Path, error)
- func (g *Graph) Neighbors(id string, kind string) ([]Edge, error)
- func (g *Graph) ShortestPath(start, end, kind string, ttl int64) ([]string, int, error)
- type Item
- type Node
- type Path
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph is backed by an in-memory bbolt database. Concurrency safety comes entirely from bbolt's transaction model: db.Update takes an exclusive write lock and db.View a read lock, and every exported operation goes through one of them. There is deliberately no additional outer mutex - a previous unused sync.Mutex field implied a locking strategy that was never actually applied.
type PriorityQueue ¶
type PriorityQueue []*Item
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.