post

package
v0.0.0-...-b46161f Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "02 Jan 2006 15:04 MST"

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Id, Author                         string
	Title, Category, Description, Body string
	HTML                               T.HTML
	Published                          bool
	Slugs, Terms, Tags                 []string
	PublishedOn                        *Time
	UpdatedAt                          *Time
	Images                             map[string]map[string]string
}

func FromFile

func FromFile(path string) (*Post, error)

func (*Post) Clean

func (p *Post) Clean() string

func (*Post) HasSlug

func (p *Post) HasSlug(slug string) bool

func (*Post) InMonth

func (p *Post) InMonth(month time.Month) bool

func (*Post) InYear

func (p *Post) InYear(year int) bool

func (*Post) OnDay

func (p *Post) OnDay(year int, month time.Month, day int) bool

func (*Post) Slug

func (p *Post) Slug() string

type PostList

type PostList []*Post

func (PostList) Len

func (pl PostList) Len() int

func (PostList) Less

func (pl PostList) Less(i, j int) bool

func (PostList) PublishedBefore

func (pl PostList) PublishedBefore(t time.Time) PostList

Assumes the list is sorted given the above functions already.

func (PostList) Swap

func (pl PostList) Swap(i, j int)

type PostSet

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

func NewPostSet

func NewPostSet() *PostSet

func (*PostSet) Add

func (ps *PostSet) Add(p *Post)

func (*PostSet) AddSet

func (ps *PostSet) AddSet(other *PostSet)

func (*PostSet) Contains

func (ps *PostSet) Contains(p *Post) bool

func (*PostSet) Intersection

func (ps *PostSet) Intersection(other *PostSet) *PostSet

func (*PostSet) Len

func (ps *PostSet) Len() int

func (*PostSet) Values

func (ps *PostSet) Values() PostList

type Time

type Time struct {
	time.Time
}

func (*Time) SetYAML

func (t *Time) SetYAML(tag string, value interface{}) bool

Jump to

Keyboard shortcuts

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