sitemap

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PriorityHigh   = 1
	PriorityMedium = 0.7
	PriorityLow    = 0.4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	Location     string
	LastModified time.Time
	Changefreq   string
	Priority     float64
}

func NewElement

func NewElement(location string) *Element

func (Element) Body

func (el Element) Body(ctx context.Context) view.View

type Page

type Page struct {
	Number int
	Count  int
}

type Sitemap

type Sitemap interface {
	Get(perpage, page uint) []Element

	Index(perpage uint) view.View
	Page(perpage, page uint) view.View

	Handler() http.Handler

	Run(timeout time.Duration)
	Stop()
}

func NewSitemap

func NewSitemap(baseurl string, builders ...SitemapBuilder) Sitemap

type SitemapBuilder

type SitemapBuilder func() ([]Element, error)

Jump to

Keyboard shortcuts

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