models

package
v0.0.0-...-e87606f Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const COLLECTION = "books"

Variables

This section is empty.

Functions

func Collection

func Collection(d *mgo.Database) *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 FindById

func FindById(d *mgo.Database, id string) *Book

func FindByObjectId

func FindByObjectId(d *mgo.Database, Id bson.ObjectId) *Book

func FindByTitle

func FindByTitle(d *mgo.Database, Title string) *Book

func GetBook

func GetBook(n string) *Book

func (*Book) Delete

func (b *Book) Delete(d *mgo.Database) error

func (*Book) Save

func (b *Book) Save(d *mgo.Database) 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