Documentation ¶
Index ¶
- type DB
- type DbHandle
- type EntityHandle
- type Match
- type MongoDb
- func (mdb *MongoDb) Connect(host string, dbName string) DbHandle
- func (mdb *MongoDb) Create(entityName string) EntityHandle
- func (mdb *MongoDb) Get(entity EntityHandle, fn func(func(interface{}) error) (interface{}, error), ...) (Row, error)
- func (mdb *MongoDb) GetEntity(entityName string) EntityHandle
- func (mdb *MongoDb) GetMatched(entity EntityHandle, fn func(func(interface{}) error) (interface{}, error), ...) ([]Row, error)
- func (mdb *MongoDb) Insert(entity EntityHandle, rowEntry Row) error
- func (mdb *MongoDb) Remove(entity EntityHandle, id ObjectId) error
- type ObjectId
- type Row
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Connect(string, string) DbHandle Create(string) EntityHandle GetEntity(string) EntityHandle Insert(EntityHandle, Row) error Remove(entity EntityHandle, id ObjectId) error Get(EntityHandle, func(fn func(interface{}) error) (interface{}, error), ObjectId) (Row, error) GetMatched(EntityHandle, func(fn func(interface{}) error) (interface{}, error), Match) ([]Row, error) }
var DbInstance DB
type EntityHandle ¶
type EntityHandle interface{}
type MongoDb ¶
type MongoDb struct {
// contains filtered or unexported fields
}
func (*MongoDb) Connect ¶
Connect establishes connection to the database server hosted in "host" and returns db handle for the given dbName
func (*MongoDb) Create ¶
func (mdb *MongoDb) Create(entityName string) EntityHandle
func (*MongoDb) GetEntity ¶
func (mdb *MongoDb) GetEntity(entityName string) EntityHandle
func (*MongoDb) GetMatched ¶
Click to show internal directories.
Click to hide internal directories.