common

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 27 Imported by: 4 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOutOfScope = errors.New("out of scope")

Functions

func BuildHttpClient added in v1.0.0

func BuildHttpClient(dialer *fastdialer.Dialer, options *types.Options, redirectCallback RedirectCallback) (*retryablehttp.Client, *fastdialer.Dialer, error)

BuildClient builds a http client based on a profile

Types

type CrawlSession added in v1.0.1

type CrawlSession struct {
	Ctx        context.Context
	CancelFunc context.CancelFunc
	URL        *url.URL
	Hostname   string
	Queue      *queue.Queue
	HttpClient *retryablehttp.Client
	Browser    *rod.Browser
}

type DoRequestFunc added in v1.0.1

type DoRequestFunc func(crawlSession *CrawlSession, req *navigation.Request) (*navigation.Response, error)

type RedirectCallback added in v1.0.0

type RedirectCallback func(resp *http.Response, depth int)

type Shared added in v1.0.1

type Shared struct {
	Headers    map[string]string
	KnownFiles *files.KnownFiles
	Options    *types.CrawlerOptions
}

func NewShared added in v1.0.1

func NewShared(options *types.CrawlerOptions) (*Shared, error)

func (*Shared) Do added in v1.0.1

func (s *Shared) Do(crawlSession *CrawlSession, doRequest DoRequestFunc) error

func (*Shared) Enqueue added in v1.0.1

func (s *Shared) Enqueue(queue *queue.Queue, navigationRequests ...*navigation.Request)

func (*Shared) NewCrawlSessionWithURL added in v1.0.1

func (s *Shared) NewCrawlSessionWithURL(URL string) (*CrawlSession, error)

func (*Shared) Output added in v1.0.1

func (s *Shared) Output(navigationRequest *navigation.Request, navigationResponse *navigation.Response, err error)

func (*Shared) ValidateScope added in v1.0.1

func (s *Shared) ValidateScope(URL string, root string) bool

Jump to

Keyboard shortcuts

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