sitemap

package
v0.5.35 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeFreq

type ChangeFreq string
const (
	Always  ChangeFreq = "always"
	Hourly  ChangeFreq = "hourly"
	Daily   ChangeFreq = "daily"
	Weekly  ChangeFreq = "weekly"
	Monthly ChangeFreq = "monthly"
	Yearly  ChangeFreq = "yearly"
	Never   ChangeFreq = "never"
)

type SitemapGenerator

type SitemapGenerator struct {
	// configurations
	OutputDirectory string // Where to hold sitemaps
	LinksPerFile    int    // maximum items per file, 5000 for google
	// contains filtered or unexported fields
}

func (*SitemapGenerator) Add

func (s *SitemapGenerator) Add(sitemapURL *SitemapURL) error

func (*SitemapGenerator) Close

func (s *SitemapGenerator) Close() error

func (*SitemapGenerator) WriteIndex

func (s *SitemapGenerator) WriteIndex(baseURL string) (string, error)

type SitemapImage

type SitemapImage struct {
	Loc string `xml:"image:loc"`
}

type SitemapLoc

type SitemapLoc struct {
	XMLName xml.Name             `xml:"sitemap"`
	Loc     string               `xml:"loc"`
	LastMod commons.NullableTime `xml:"lastmod"`
}

type SitemapParser

type SitemapParser struct {
	RequestHeaders map[string]string
	AcceptSitemap  func(url *SitemapLoc) bool
	OnURLFound     func(url *SitemapURL)
	OnParseError   func(error)
}

func (*SitemapParser) Headers added in v0.5.35

func (p *SitemapParser) Headers() map[string]string

func (*SitemapParser) LoadRobots

func (p *SitemapParser) LoadRobots(robotsURL string) error

func (*SitemapParser) LoadURL

func (p *SitemapParser) LoadURL(sitemapURL string) error

type SitemapURL

type SitemapURL struct {
	XMLName    xml.Name             `xml:"url"`
	Loc        string               `xml:"loc"`
	LastMod    commons.NullableTime `xml:"lastmod"`
	ChangeFreq ChangeFreq           `xml:"changefreq"`
	Priority   float64              `xml:"priority"`
	Images     []*SitemapImage      `xml:"image:image"`
}

Jump to

Keyboard shortcuts

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