pkg

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

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchLinks(config LinkConfig) []string

FetchLinks fetch links with crawler

Types

type LinkConfig

type LinkConfig struct {
	Host          string
	Destination   string
	ExternalLinks bool
	RespectTree   bool
}

LinkConfig config links

func (LinkConfig) IsFile

func (config LinkConfig) IsFile(uri string) bool

IsFile detects if the url is a file

func (LinkConfig) IsInHost

func (config LinkConfig) IsInHost(uri string) bool

IsInHost returns true if is the same host

type LinkTree

type LinkTree struct {
	Value  string
	Childs []*LinkTree
}

LinkTree tree of links. It respects the link hierarchy

func (t *LinkTree) AddLink(link string)

AddLink will add a link to itself as child or to its child if it is in the same root e.g. would add /a/b to /a but not /c to /a

func (t *LinkTree) AddLinks(links ...string)

AddLinks add links to a tree

func (t *LinkTree) GetLinks() (links []string)

GetLinks get links

func (*LinkTree) IsChild

func (t *LinkTree) IsChild(link string, checkChilds bool) (response bool)

IsChild returns true if link is child of the node

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer printer type for pdf renderer

func NewPrinter

func NewPrinter(config LinkConfig) *Printer

NewPrinter creates a new Printer

func (*Printer) Start

func (p *Printer) Start() (links []string)

Start starts rendering pdf

Jump to

Keyboard shortcuts

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