crawler

package
v0.0.0-...-3904890 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 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 Config

type Config struct {
	// Whether or not to follow external links on a scraped page
	FollowExternalLinks bool
}

Config represents crawler configuration

type Crawler

type Crawler struct {
	fetcher.Fetcher
	*logr.Logger
	Config
}

Crawler holds the crawler data structure

func NewCrawler

func NewCrawler(f fetcher.Fetcher, l *logr.Logger, cfg Config) *Crawler

NewCrawler builds a `Crawler` object

func (*Crawler) Crawl

func (c *Crawler) Crawl(url string) ([]string, error)

Crawl receivers a string `url` and it will return the links ([]string) found

Jump to

Keyboard shortcuts

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