crawler

package
v0.0.0-...-30bc237 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grawler

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

Grawler is the way to crawl urls

func NewGrawler

func NewGrawler(
	url *url.URL,
	maxConcurrency int,
	extractStaticAssets bool,
) *Grawler

NewGrawler returns a new Grawler instance

func (*Grawler) Crawl

func (g *Grawler) Crawl() map[string]*SiteNode

Crawl crawls the url for links

type SiteNode

type SiteNode struct {
	NodeURL              *url.URL
	IsCrawled            bool
	InternalStaticAssets map[string]bool // hash map will also serve as keeping the list unique. Ideally better to use a hash-set (not available in golang yet)
	InternalLinks        map[string]bool
}

SiteNode is a struct that encapsulates the website node

Jump to

Keyboard shortcuts

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