graph

package
v0.0.0-...-d3e0cf2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 object

Store map of page name: list of links on that page

use Put, Get to access pages map

func NewGraph

func NewGraph(filename string) *Graph

NewGraph initializes a graph

func (*Graph) Close

func (g *Graph) Close()

Close passes through to bolt.Close

func (*Graph) Flush

func (g *Graph) Flush()

Flush makes sure buffer is empty and all data is stored in boltdb

func (*Graph) Get

func (g *Graph) Get(page string) []string

Get list of links on a given page

func (*Graph) Linked

func (g *Graph) Linked(source, dest string) bool

Linked returns true if link to dest on the source page

func (*Graph) Path

func (g *Graph) Path(source, dest string) string

Path search using A* algorithm, returns path as a human readable string

func (*Graph) Put

func (g *Graph) Put(page string, value []string)

Put saves a list of links on a given page

type Queue

type Queue list.List

Queue type used in search

func NewQueue

func NewQueue() *Queue

NewQueue initializes a new queue object

func (*Queue) Pop

func (q *Queue) Pop() (string, bool)

Pop removes and returns a node from the queue in first to last order.

func (*Queue) Push

func (q *Queue) Push(s string)

Push adds a node to the queue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL