Documentation ¶
Index ¶
Constants ¶
const ( // MAPLIMIT defines how many items can be used within a // sitemap.xml before splitting into a new one. MAPLIMIT = 49999 )
const (
SiteMapsDir = "sitemaps"
)
Variables ¶
var AssetsChan = make(chan int, api.AssetsChannel)
AssetsChan is the channel for serving assets for the frontend.
var ( // NoPostFound is returned by page when lookup failed. NoPostFound = errors.New("no post found") )
var ServeChan = make(chan int, api.ServerChannel)
ServeChan is the channel for serving pages for the frontend.
var UploadChan = make(chan int, api.UploadChannel)
UploadChan is the channel for serving uploads for the frontend.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
type Publisher ¶
type Publisher interface { Asset(g *gin.Context, webp bool) (*[]byte, domain.Mime, error) Upload(g *gin.Context, webp bool) (*[]byte, domain.Mime, error) Page(g *gin.Context) ([]byte, error) NotFound(g *gin.Context) SiteMap() SiteMapper }
Publisher
type SiteMapper ¶
type SiteMapper interface { Index() ([]byte, error) Pages(resource string) ([]byte, error) XSL(index bool) ([]byte, error) ClearCache() }
SiteMapper represents functions for executing the sitemap data.
type Sitemap ¶
type Sitemap struct {
// contains filtered or unexported fields
}
Sitemap represents the generation of sitemap.xml files for use with the sitemap controller.
func (*Sitemap) ClearCache ¶
func (s *Sitemap) ClearCache()
ClearCache - Clears all of the cached data from the index.xml file as well as the resources xml files.
Returns no error.
func (*Sitemap) Index ¶
Index
Index first checks to see if the sitemap serving is enabled in the options, then goes on to retrieve the pages. template data is then constructed and executed.
Returns errors.CONFLICT if the sitemap serve options was not enabled.
func (*Sitemap) Pages ¶
Pages first checks to see if the sitemap serving is enabled in the options, then goes on to retrieve the pages. template data is then constructed and executed.
Returns errors.CONFLICT if the sitemap serve options was not enabled. Returns errors.INTERNAL if the pages template was unable to be executed. Returns errors.NOTFOUND if the given resource was not found within the resource or redirects.