sitemap

package
v0.0.0-...-8fe63c4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNodes

func BuildNodes(linksDB map[string]data.Request, urlDB map[string]data.Request) map[string]*Node

BuildNodes DB to page Nodes

func Display

func Display(sorted []*Node)

Display shows Nodes as strings by weight

func DisplayBFS

func DisplayBFS(sorted []*Node)

DisplayBFS shows nodes once Breadth First Search

Types

type BasicSiteMap

type BasicSiteMap struct {
	LinksDB storage.BasicInMemoryDB
	URLDB   storage.BasicInMemoryDB
}

BasicSiteMap is a SiteMap that works with BasicInMemoryDB

func (BasicSiteMap) Output

func (sm BasicSiteMap) Output()

Output converts a DB into output (strings)

type Node

type Node struct {
	Key         string
	LinksIn     []*Node
	LinksOut    []*Node
	VisitedFrom *Node
}

Node represents a page with links coming in and out from other pages

func BFS

func BFS(startNode *Node) []*Node

BFS does search for nodes https://en.wikipedia.org/wiki/Breadth-first_search

func GetNode

func GetNode(m map[string]*Node, key string) *Node

GetNode gets or creates the node for a new page

func SortWeightedList

func SortWeightedList(weighted map[string]*Node) []*Node

SortWeightedList pseudo page-rank, reverse link/number of pages linking in

func (Node) Value

func (n Node) Value() int

Value represents the weight of a page, pseudo page-rank counts links coming in

type Sitemap

type Sitemap interface {
	Output()
}

Sitemap is the interface for outputing SiteMaps

Jump to

Keyboard shortcuts

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