Versions in this module Expand all Collapse all v0 v0.0.2 May 15, 2018 v0.0.1 Dec 6, 2017 Changes in this version + var MONGO_DIAL_TIMEOUT = 0 * time.Second + var MONGO_SOCKET_TIMEOUT = 3 * time.Second + var MONGO_SYNC_TIMEOUT = 3 * time.Second + func Close(addrs string) + func CloseAll() + func Define(c *Collection) + type Collection struct + Indexes []mgo.Index + Name string + OnCreate OnCreate + Sample interface{} + type Dao struct + Collection *Collection + Database *Database + func NewDao(name string, db *Database) *Dao + func (d *Dao) Create() *Item + func (d *Dao) Delete(query bson.M) (n int, err error) + func (d *Dao) Find(query interface{}) *Query + func (d *Dao) FindById(id interface{}) (*Item, error) + func (d *Dao) FindOne(query interface{}) (*Item, error) + func (d *Dao) Insert(o *Item) error + type Database struct + func NewDatabase(mongourl string) (*Database, error) + func (d *Database) C(collection string) *mgo.Collection + func (d *Database) Clone() *Database + func (d *Database) Close() + func (d *Database) GetName() string + type Item struct + Dao *Dao + Value interface{} + func (i *Item) Delete() error + func (i *Item) GetId() interface{} + func (i *Item) Patch(p *Patch) error + func (i *Item) Reload() error + func (i *Item) Save() error + func (i *Item) Where(condition bson.M) *Item + type Kip struct + func Global() *Kip + func NewKip() *Kip + func (k *Kip) Define(c *Collection) + func (k *Kip) NewDao(name string, database *Database) *Dao + type OnCreate func() interface + type Patch struct + Key string + Operation string + Value interface{} + type Query struct + func (q *Query) All(result interface{}) error + func (q *Query) Count() (n int, err error) + func (q *Query) ForEach(f func(*Item)) error + func (q *Query) Iter() (*mgo.Iter, *Database) + func (q *Query) Limit(n int) *Query + func (q *Query) One(result interface{}) error + func (q *Query) Select(projection interface{}) *Query + func (q *Query) Skip(n int) *Query + func (q *Query) Snapshot() *Query + func (q *Query) Sort(fields ...string) *Query