publisher

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MAPLIMIT defines how many items can be used within a
	// sitemap.xml before splitting into a new one.
	MAPLIMIT = 49999
)
View Source
const (
	SiteMapsDir = "sitemaps"
)

Variables

View Source
var AssetsChan = make(chan int, api.AssetsChannel)

AssetsChan is the channel for serving assets for the frontend.

View Source
var (
	// NoPostFound is returned by page when lookup failed.
	NoPostFound = errors.New("no post found")
)
View Source
var ServeChan = make(chan int, api.ServerChannel)

ServeChan is the channel for serving pages for the frontend.

View Source
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 ErrorHandler interface {
	NotFound(g *gin.Context)
}

type Errors

type Errors struct {
	*deps.Deps
}

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

func NewRender

func NewRender(d *deps.Deps) Publisher

NewRender - Construct

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 NewSitemap

func NewSitemap(d *deps.Deps) *Sitemap

NewSitemap - Construct

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

func (s *Sitemap) Index() ([]byte, error)

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

func (s *Sitemap) Pages(resource string) ([]byte, error)

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.

func (*Sitemap) XSL

func (s *Sitemap) XSL(index bool) ([]byte, error)

XSL reads the main index XSL file from the sitemaps template path for use with the sitemap-xml file.

Returns errors.INTERNAL if the ioutil function failed to read the path.

Jump to

Keyboard shortcuts

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