README
¶
sitemap
Sitemap protocol library in Go.
Install
Go version 1.13
go get github.com/FoodyTech/sitemap
Example
mysite := `<some sitemap in XML>`
smap, err := sitemap.ParseString(mysite)
if err != nil {
// process on error
}
for _, url := smap.URL {
println(url.Location)
println(url.LastModification)
println()
}
Documentation
See these docs.
License
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder helps to build own site map.
type Sitemap ¶
type Sitemap struct { XMLName xml.Name `xml:"urlset" json:"-"` Text string `xml:",chardata" json:"text"` Xmlns string `xml:"xmlns,attr" json:"-"` URL []URL `xml:"url" json:"url"` }
Sitemap represents a sitemap protocol. See: https://www.sitemaps.org/protocol.html
type URL ¶
type URL struct { Text string `xml:",chardata" json:"chardata"` Location string `xml:"loc" json:"loc"` LastModification string `xml:"lastmod" json:"lastmod"` ChangeFrequency string `xml:"changefreq" json:"changefreq"` Priority string `xml:"priority" json:"priority"` }
URL represents Sitemap URL entry.
Click to show internal directories.
Click to hide internal directories.