Help us shape the future of Go! Take the 2026 Go Developer Survey

sitemap

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sitemap

type Sitemap struct {
	XMLName   xml.Name
	Namespace string `xml:"xmlns,attr"`

	URLs     []URL `xml:"url"`
	Sitemaps []URL `xml:"sitemap"`
}

Sitemap represents a sitemap

func NewSitemap

func NewSitemap() *Sitemap

NewSitemap creates a sitemap

func NewSitemapIndex

func NewSitemapIndex() *Sitemap

NewSitemapIndex creates a sitemap index.

func (*Sitemap) Add

func (s *Sitemap) Add(u URL)

Add adds a URL to the sitemap

func (*Sitemap) WriteTo

func (s *Sitemap) WriteTo(w io.Writer) (int64, error)

WriteTo writes the sitemap to a response

type URL

type URL struct {
	URL     string     `xml:"loc"`
	LastMod *time.Time `xml:"lastmod,omitempty"`
}

URL represents a single sitemap entry

Source Files

  • sitemap.go

Jump to

Keyboard shortcuts

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