models

package
v0.0.0-...-aafe118 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection(s *mgo.Session) *mgo.Collection

Types

type Book

type Book struct {
	Id    bson.ObjectId `bson:"_id,omitempty"`
	Title string        `bson:"Title"`
	Body  string        `bson:"Body"`
	Tags  []string      `bson:"Tags"`
}

func GetBook

func GetBook(n string) *Book

func GetBookById

func GetBookById(s *mgo.Session, Id string) *Book

func GetBookByObjectId

func GetBookByObjectId(s *mgo.Session, Id bson.ObjectId) *Book

func GetBookByTitle

func GetBookByTitle(s *mgo.Session, Title string) *Book

func (*Book) Delete

func (b *Book) Delete(s *mgo.Session) error

func (*Book) Save

func (b *Book) Save(s *mgo.Session) error

func (*Book) String

func (b *Book) String() string

Jump to

Keyboard shortcuts

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