shared

package
v0.0.0-...-fd00b2c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PageAndOffset

func PageAndOffset(r *http.Request, pageSize int64) (int64, int64, error)

func PageCount

func PageCount(total, size int64) int64

Types

type NewsCache

type NewsCache struct {
	// contains filtered or unexported fields
}

func NewNewsCache

func NewNewsCache() *NewsCache

func (*NewsCache) Empty

func (nc *NewsCache) Empty(post radio.NewsPost)

Empty clears the cache of the post given, this clears the Body and Header cache

func (*NewsCache) EmptyBefore

func (nc *NewsCache) EmptyBefore(t time.Time)

EmptyBefore removes any entries from the cache that had been generated before the time given

func (*NewsCache) RenderBody

func (nc *NewsCache) RenderBody(post radio.NewsPost) (NewsMarkdown, error)

func (*NewsCache) RenderComment

func (nc *NewsCache) RenderComment(comment radio.NewsComment) (NewsMarkdown, error)

func (*NewsCache) RenderHeader

func (nc *NewsCache) RenderHeader(post radio.NewsPost) (NewsMarkdown, error)

type NewsMarkdown

type NewsMarkdown struct {
	GeneratedAt   time.Time
	HasHiddenHTML bool
	Source        string
	Output        template.HTML
}

type Pagination

type Pagination struct {
	Nr    int64
	Total int64
	// contains filtered or unexported fields
}

func NewPagination

func NewPagination(currentPage, totalPages int64, uri *url.URL) *Pagination

func (*Pagination) BaseURL

func (p *Pagination) BaseURL() template.URL

func (*Pagination) First

func (p *Pagination) First() *Pagination

func (*Pagination) Last

func (p *Pagination) Last() *Pagination

func (*Pagination) Next

func (p *Pagination) Next(offset int64) *Pagination

func (*Pagination) Prev

func (p *Pagination) Prev(offset int64) *Pagination

func (*Pagination) URL

func (p *Pagination) URL() template.URL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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