models

package
v0.0.0-...-7e7e0c3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddEntry

func AddEntry(e Entry) (string, error)

func CreateCollection

func CreateCollection(c Collection) (string, error)

func DeleteCollection

func DeleteCollection(id string) error

func DeleteEntry

func DeleteEntry(id string) error

func Hash

func Hash(s string) string

func UpdateCollection

func UpdateCollection(c Collection) (string, error)

func UpdateEntry

func UpdateEntry(e Entry) error

Types

type Author

type Author struct {
	Name     string `json:"name" form:"name"`
	Password string `json:"password" form:"password"`
}

func AddAuthor

func AddAuthor(name, password string) (*Author, error)

func AuthorByName

func AuthorByName(name string) (*Author, error)

type Collection

type Collection struct {
	Id       string `json:"id"`
	Title    string `json:"title" form:"title"`
	Subtitle string `json:"subtitle" form:"subtitle"`
	Author   string `json:"author"`
	Date     string `json:"date"`
}

func AllCollections

func AllCollections() ([]Collection, error)

func CollectionById

func CollectionById(id string) (Collection, error)

func CollectionsByUser

func CollectionsByUser(name string) ([]Collection, error)

type Entry

type Entry struct {
	Id         string `json:"id"`
	Title      string `json:"title" form:"title"`
	Subtitle   string `json:"subtitle" form:"subtitle"`
	Author     string `json:"author"`
	Date       string `json:"date"`
	Collection string `json:"collection form:"collection"`
	Content    string `json:"content" form:"content"`
	Likes      int    `json:"likes"`
	Status     string `json:"status" form:"status"`
}

func AllEntries

func AllEntries() ([]Entry, error)

func EntriesByCollection

func EntriesByCollection(cid, dir, eid string) ([]Entry, bool, bool, error)

func EntriesByUser

func EntriesByUser(name string) ([]Entry, error)

func EntryById

func EntryById(id string) (*Entry, error)

func PublishedEntries

func PublishedEntries(dir, id string) ([]Entry, bool, bool, error)

Jump to

Keyboard shortcuts

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