datatypes

package
v0.0.0-...-90f9a36 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SiteMapItemList

type SiteMapItemList []*SitemapItem

SiteMapItemList implements sort.Interface

func (SiteMapItemList) Len

func (s SiteMapItemList) Len() int

func (SiteMapItemList) Less

func (s SiteMapItemList) Less(i, j int) bool

func (SiteMapItemList) Swap

func (s SiteMapItemList) Swap(i, j int)

type Sitemap

type Sitemap struct {
	XMLName []struct{}      `xml:"urlset"`
	List    SiteMapItemList `xml:"url"`
	Xmlns   string          `xml:"xmlns,attr"`
	XmlnsDO string          `xml:"xmlns:webcrawler,attr"`
}

Sitemap represents the main structure to render a sitemap xml file.

type SitemapItem

type SitemapItem struct {
	Location     string    `xml:"loc"`
	Links        []string  `xml:"webcrawler:links>webcrawler:link"`
	Assets       []string  `xml:"webcrawler:assets>webcrawler:asset"`
	ErrorInFetch bool      `xml:"webcrawler:error"`
	ErrorMessage string    `xml:"webcrawler:errormessage,omitempty"`
	Updated      time.Time `xml:"webcrawler:updated"`
}

SitemapItem represents a SitemapList item

type SitemapList

type SitemapList struct {
	List map[string]*SitemapItem
	// contains filtered or unexported fields
}

SitemapList represents a thread-safe list to keep the sitemap itens

func NewSitemapList

func NewSitemapList() *SitemapList

NewSitemapList creates a new SitemapList instance

func (*SitemapList) Add

func (smt *SitemapList) Add(item *SitemapItem)

Add a new item

func (*SitemapList) CreateSitemap

func (sl *SitemapList) CreateSitemap() Sitemap

CreateSitemap generates a Sitemap xml structure

func (*SitemapList) Search

func (smt *SitemapList) Search(location string) *SitemapItem

Search a specific item by location

Jump to

Keyboard shortcuts

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