gocrawler

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractEmails added in v1.4.5

func ExtractEmails(page string) []string

func ExtractUrls added in v1.4.5

func ExtractUrls(page string, url string) []string

Types

type Callback

type Callback func(response CrawlResponse)

type Config

type Config struct {
	MaxThreads  uint
	MaxRequests int
	Headers     http.Header
}

func DefaultConfig

func DefaultConfig() *Config

type CrawlResponse added in v1.5.1

type CrawlResponse struct {
	URL      string
	Response http.Response
	Body     string
}

type Crawler

type Crawler struct {
	Scope *types.Scope

	Discovered *utils.StringSet

	Config *Config
	// contains filtered or unexported fields
}

func New

func New(scope *types.Scope, config *Config) *Crawler

func (*Crawler) AddCallback

func (cr *Crawler) AddCallback(f Callback) int

/ Adds a callback to the crawler / Returns a handler to remove the callback

func (*Crawler) Crawl

func (cr *Crawler) Crawl(endpoints []string)

func (*Crawler) RemoveCallback added in v1.4.7

func (cr *Crawler) RemoveCallback(handler int)

Jump to

Keyboard shortcuts

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