tree

package
v0.0.0-...-a7fb1eb Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coverage

type Coverage struct {
	// exact url this coverage information is about
	Url string `json:"url,omitempty"`
	// id of the coverage
	RepositoryId string `json:"repositoryId"`
	// sha256 hash of the response (if present)
	Sha256 string `json:"sha256,omitempty"`
	// time of capture from this url
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// url to where this archive now lives
	ArchiveUrl string `json:"archiveUrl,omitempty"`
	// flag for wather or not this archive is in fact complete
	Archived bool `json:"archived"`
	// basic flag for if this url contains data that is difficult
	// to archive with conventional scraping means
	Uncrawlable bool `json:"uncrawlable,omitempty"`
	// a number from 0-10 (10 being high priority) for archiving
	Priority int `json:"priority"`
}

Coverage is information provided by a repository about a url

type Node

type Node struct {
	Id                     string      `json:"-"`
	Name                   string      `json:"name"`
	NumDescendants         int         `json:"-"`
	NumDescendantsArchived int         `json:"-"`
	NumLeaves              int         `json:"numLeaves,omitempty"`
	NumLeavesArchived      int         `json:"numLeavesArchived,omitempty"`
	NumChildren            int         `json:"numChildren,omitempty"`
	Archived               bool        `json:"archived,omitempty"`
	ArchiveCount           int         `json:"archiveCount,omitempty"`
	Children               []*Node     `json:"children,omitempty"`
	Coverage               []*Coverage `json:"coverage,omitempty"`
}

Node is a url component in the coverage tree

func CopyToDepth

func CopyToDepth(node *Node, depth int) *Node

func (*Node) Child

func (n *Node) Child(name string) *Node

func (*Node) Copy

func (n *Node) Copy() *Node

func (*Node) Find

func (n *Node) Find(id string) (found *Node)

func (*Node) PrintTree

func (n *Node) PrintTree(depth, maxDepth int, initial, indent string)

func (*Node) SortChildren

func (n *Node) SortChildren()

func (*Node) Walk

func (n *Node) Walk(visit func(*Node))

Jump to

Keyboard shortcuts

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