robots

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalRobotsCache = &RobotsCache{
	cache: make(map[string]*robotsEntry),
}

Functions

func GetSitemaps added in v0.4.0

func GetSitemaps(targetURL string) ([]string, error)

func IsURLAllowed

func IsURLAllowed(targetURL string) bool

Check if URL is allowed

Types

type RobotsCache

type RobotsCache struct {
	RobotName string
	// contains filtered or unexported fields
}

func (*RobotsCache) GetRobotsForDomain

func (rc *RobotsCache) GetRobotsForDomain(scheme string, domain string) (*robotsEntry, error)

Fetch and parse robots.txt with caching

func (*RobotsCache) SetClient added in v0.6.0

func (rc *RobotsCache) SetClient(client *http.Client)

type Sitemap added in v0.4.0

type Sitemap struct {
	Loc     string    `xml:"loc"`
	Lastmod time.Time `xml:"lastmod"`
	URLSet  URLSet
}

type SitemapIndex added in v0.4.0

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

func NewSitemapIndex added in v0.4.0

func NewSitemapIndex(link string) *SitemapIndex

func (*SitemapIndex) GetURLs added in v0.4.0

func (s *SitemapIndex) GetURLs() []URL

func (*SitemapIndex) Process added in v0.4.0

func (s *SitemapIndex) Process() bool

type SitemapInterface added in v0.4.0

type SitemapInterface interface {
	Process() bool
	GetURLs() []string
}

type URL added in v0.4.0

type URL struct {
	Loc     string    `xml:"loc"`
	Lastmod time.Time `xml:"lastmod"`
}

func ExtractURLs added in v0.4.0

func ExtractURLs(smap string) []URL

type URLSet added in v0.4.0

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

func NewURLSet added in v0.4.0

func NewURLSet(link string) *URLSet

func (*URLSet) GetURLs added in v0.4.0

func (s *URLSet) GetURLs() []URL

func (*URLSet) Process added in v0.4.0

func (s *URLSet) Process() bool

Jump to

Keyboard shortcuts

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