Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fetcher ¶
type Fetcher interface { // Fetch returns the slice of URLs found on that page. // LinksExtractor allows processing links post fetching. Fetch(string, LinksExtractor) ([]string, error) }
Fetcher represents an object capable of fetching URLs from a given url
type LinksExtractor ¶
LinksExtractor extracts links from a given io.Reader It allows user to customize how the links should be extracted from given page.
type SimpleFetcher ¶
type SimpleFetcher struct {
// contains filtered or unexported fields
}
SimpleFetcher implements Fetcher
func NewSimpleFetcher ¶
func NewSimpleFetcher(url string) *SimpleFetcher
NewSimpleFetcher creates a new fetcher with the given base URL. It also creates a new http.Client with 5 seconds timeout
func (SimpleFetcher) Fetch ¶
func (f SimpleFetcher) Fetch(url string, le LinksExtractor) ([]string, error)
Fetch pulls all the URLs on the page at `url`. Returns list of URLs found on the page
Click to show internal directories.
Click to hide internal directories.