golbStore

package module
v0.0.0-...-9789687 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2014 License: MIT Imports: 2 Imported by: 0

README

golbStore

a simple package for storing blog posts in a database. currently mgo is used.

originally this was part of @willnix' tinkerBlog.

TODO

  • more stuff

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEntryNotFound = errors.New("no Blog Entry with that ID")

ErrEntryNotFound is returned when a blog entry could not be found in the store

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID      string    `bson:"_"`
	Author  string    `bson:"author,omitempty"`
	Written time.Time `bson:"written,omitempty"`
	Title   string    `bson:"title"`
	Text    string    `bson:"text"`
	Teaser  string    `bson:"teaser"`
}

Entry represents an entry in the blog - for all Storeage backends

type GolbStorer

type GolbStorer interface {
	Latest(n int, withText bool) ([]*Entry, error)
	Get(id string) (*Entry, error)
	Save(e *Entry) error
	Delete(id string) error
}

The GolbStorer interface represents an abstracted store

Directories

Path Synopsis
Package golbStoreIpsum is an in-memory version of the blog that returns Lorem Ipsum-esque text for testing purpose
Package golbStoreIpsum is an in-memory version of the blog that returns Lorem Ipsum-esque text for testing purpose

Jump to

Keyboard shortcuts

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