crawler

package
v0.0.0-...-35e70cf Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrawlMode

type CrawlMode string
const (
	LightMode  CrawlMode = "light"
	FullMode   CrawlMode = "full"
	CustomMode CrawlMode = "custom"
)

type Crawler

type Crawler struct {
	Config *CrawlerConfig
	Parser *parser.Parser

	Mutex *sync.Mutex
	// contains filtered or unexported fields
}

func (*Crawler) Crawl

func (crawler *Crawler) Crawl(urls *[]string) error

func (*Crawler) LaunchWarm

func (crawler *Crawler) LaunchWarm(urls *[]string)

func (*Crawler) UrlsFromSitemap

func (crawler *Crawler) UrlsFromSitemap(url string, result *[]string) error

func (*Crawler) WarmCache

func (crawler *Crawler) WarmCache(originUrl string) error

type CrawlerConfig

type CrawlerConfig struct {
	Interval time.Duration
	Mode     CrawlMode
}

type Urlset

type Urlset struct {
	XMLName xml.Name `xml:"urlset"`
	Text    string   `xml:",chardata"`
	Xmlns   string   `xml:"xmlns,attr"`
	Image   string   `xml:"image,attr"`
	URL     []struct {
		Text       string `xml:",chardata"`
		Loc        string `xml:"loc"`
		Changefreq string `xml:"changefreq"`
		Priority   string `xml:"priority"`
		Lastmod    string `xml:"lastmod"`
		Image      []struct {
			Text    string `xml:",chardata"`
			Loc     string `xml:"loc"`
			Caption string `xml:"caption"`
			Title   string `xml:"title"`
		} `xml:"image"`
	} `xml:"url"`
}

Jump to

Keyboard shortcuts

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