crawler

package
v0.0.0-...-f3ad2b4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrawlItem

type CrawlItem struct {
	Url     string
	Retries int
	Result  Result
}

type Crawler

type Crawler struct {
	sync.Mutex

	ConcurrentRequests int
	MaxRetries         int

	AllowCrawlPatterns []*regexp.Regexp

	Logger *logrus.Logger

	Client *http.Client
	// contains filtered or unexported fields
}

func New

func New(concurrentRequests int, hosts []string, startUrls []string) *Crawler

func (*Crawler) AddUrl

func (c *Crawler) AddUrl(url string)

func (*Crawler) AddUrls

func (c *Crawler) AddUrls(urls []string)

func (*Crawler) Run

func (c *Crawler) Run()

type Result

type Result struct {
	// The final (possibly redirected) url.
	Url string

	Error    error
	CanRetry bool

	Urls []string
}

Jump to

Keyboard shortcuts

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