PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/app/domain/book_finders.go

http://github.com/sut-go/gon
Go | 22 lines | 13 code | 4 blank | 5 comment | 0 complexity | 7848567234533565925e31f65956554a MD5 | raw file
 1/**
 2  This should be an auto-generated file
 3  similar to those in the ROO framework.
 4**/
 5
 6package book
 7
 8import "launchpad.net/gobson/bson"
 9import "launchpad.net/mgo"
10
11type BookService struct {
12    *mgo.Session
13    // EntityManager
14}
15
16func (b *BookService) Get(id string) (result *Book) {
17	c := b.DB("gon").C("book")
18	defer b.Close()
19	result = new(Book)
20	_ = c.Find(bson.M{"_id": id}).One(result)
21	return
22}