crawler

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchSitemaps

func FetchSitemaps(url string, skipCertCheck bool) ([]string, error)

func GetClient added in v0.1.2

func GetClient(skipCertCheck bool) *http.Client

Types

type CrawlResult

type CrawlResult struct {
	// contains filtered or unexported fields
}

func (*CrawlResult) AddPageResult

func (cr *CrawlResult) AddPageResult(result PageResult)

func (*CrawlResult) GetResults

func (cr *CrawlResult) GetResults() []PageResult

type PageResult

type PageResult struct {
	URL        string
	StatusCode int
	Error      error
	Response   string
}

func Crawl

func Crawl(urls []URL, concurrency int, skipCertCheck bool) []PageResult

type Sitemap

type Sitemap struct {
	Loc string `xml:"loc"`
}

type SitemapIndex

type SitemapIndex struct {
	XMLName  xml.Name  `xml:"sitemapindex"`
	Sitemaps []Sitemap `xml:"sitemap"`
}

type SitemapResult

type SitemapResult struct {
	// contains filtered or unexported fields
}

func (*SitemapResult) AddPageResult

func (sr *SitemapResult) AddPageResult(result PageResult)

func (*SitemapResult) GetResults

func (sr *SitemapResult) GetResults() []PageResult

type URL

type URL struct {
	Loc        string `xml:"loc"`
	LastMod    string `xml:"lastmod"`
	ChangeFreq string `xml:"changefreq"`
	Priority   string `xml:"priority"`
}

type URLSet

type URLSet struct {
	XMLName xml.Name `xml:"urlset"`
	URLs    []URL    `xml:"url"`
}

func FetchSitemap

func FetchSitemap(url string, skipCertCheck bool) (URLSet, error)

Jump to

Keyboard shortcuts

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