golbStoreMgo

package
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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadObjectID = errors.New("error while validating entry ID")

ErrBadObjectID is returned when the ID is not a valid Mgo ObjectId

Functions

func NewStore

func NewStore(session *mgo.Session, o *Options) golbStore.GolbStorer

NewStore creates a new mgo based golbStore

Types

type MgoBlog

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

MgoBlog is the the Mgo version of a golbStore

func (MgoBlog) Delete

func (b MgoBlog) Delete(id string) error

Delete drops the entry with id from the store

func (MgoBlog) Get

func (b MgoBlog) Get(id string) (e *golbStore.Entry, err error)

Get loads a single Entry

func (MgoBlog) Latest

func (b MgoBlog) Latest(n int, withText bool) (entries []*golbStore.Entry, err error)

Latest loads n Blogentries in the results slice (sorted descending by date)

func (MgoBlog) Save

func (b MgoBlog) Save(e *golbStore.Entry) error

Save updates an entry

type Options

type Options struct {
	DbName         string
	CollectionName string
}

Options pass the Db- and CollectionName to the Mgo driver

Jump to

Keyboard shortcuts

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