Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Spider)
Option is a function that configures the spider.
func WithConcurrency ¶
WithConcurrency sets how many workers will request urls concurrently.
func WithIgnoreRobots ¶
WithIgnoreRobots sets whether or not the spider should ignore the robots.txt data.
func WithRequester ¶
WithRequester sets the requester that the spider should use to make requests.
func WithUserAgent ¶
WithUserAgent overwrites the default user agent.
type Requester ¶
type Requester interface { Request(ctx context.Context, uri *url.URL) ([]byte, error) SetUserAgent(agent string) }
Requester is something that can make a request.
type Spider ¶
type Spider struct {
// contains filtered or unexported fields
}
Spider can run requests against a URI until it sees every internal page on that site at least once. It can be configued with Option arguments which override defaults.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
concurrency
Package concurrency provides common concurrency patterns and utilities.
|
Package concurrency provides common concurrency patterns and utilities. |
Click to show internal directories.
Click to hide internal directories.