Documentation ¶
Index ¶
- func PageAndOffset(r *http.Request, pageSize int64) (int64, int64, error)
- func PageCount(total, size int64) int64
- type NewsCache
- func (nc *NewsCache) Empty(post radio.NewsPost)
- func (nc *NewsCache) EmptyBefore(t time.Time)
- func (nc *NewsCache) RenderBody(post radio.NewsPost) (NewsMarkdown, error)
- func (nc *NewsCache) RenderComment(comment radio.NewsComment) (NewsMarkdown, error)
- func (nc *NewsCache) RenderHeader(post radio.NewsPost) (NewsMarkdown, error)
- type NewsMarkdown
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NewsCache ¶
type NewsCache struct {
// contains filtered or unexported fields
}
func NewNewsCache ¶
func NewNewsCache() *NewsCache
func (*NewsCache) Empty ¶
Empty clears the cache of the post given, this clears the Body and Header cache
func (*NewsCache) EmptyBefore ¶
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 Pagination ¶
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
Click to show internal directories.
Click to hide internal directories.