Documentation ¶
Index ¶
- Constants
- Variables
- type M
- type MongoDBInfo
- type MongoDBMgr
- func (mgr *MongoDBMgr) Close()
- func (mgr *MongoDBMgr) DBQuery(collection string, cond interface{}, result *[]map[string]interface{}) error
- func (mgr *MongoDBMgr) DBQueryOneResult(collection string, cond interface{}, result map[string]interface{}) error
- func (mgr *MongoDBMgr) GetDbSession() *mgo.Session
- func (mgr *MongoDBMgr) Insert(collection string, doc interface{}) error
- func (mgr *MongoDBMgr) Ping() error
- func (mgr *MongoDBMgr) RefreshSession()
- func (mgr *MongoDBMgr) RemoveAll(collection string, cond interface{}) error
- func (mgr *MongoDBMgr) RemoveOne(collection string, condName string, condValue int64) error
- func (mgr *MongoDBMgr) RemoveOneByCond(collection string, cond interface{}) error
- func (mgr *MongoDBMgr) SetMode(mode int, refresh bool)
- func (mgr *MongoDBMgr) Start() error
- func (mgr *MongoDBMgr) Update(collection string, cond interface{}, change interface{}) error
- func (mgr *MongoDBMgr) UpdateInsert(collection string, cond interface{}, doc interface{}) error
Constants ¶
View Source
const ( Strong = 1 Monotonic = 2 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type MongoDBInfo ¶
func NewMongoDBInfo ¶
func NewMongoDBInfo(host string, port int, name, user, pass string) *MongoDBInfo
func (*MongoDBInfo) String ¶
func (mi *MongoDBInfo) String() string
type MongoDBMgr ¶
type MongoDBMgr struct {
// contains filtered or unexported fields
}
func NewMongoDBMgr ¶
func NewMongoDBMgr(dbcfg *MongoDBInfo, timeout time.Duration) *MongoDBMgr
func (*MongoDBMgr) Close ¶
func (mgr *MongoDBMgr) Close()
func (*MongoDBMgr) DBQuery ¶
func (mgr *MongoDBMgr) DBQuery(collection string, cond interface{}, result *[]map[string]interface{}) error
func (*MongoDBMgr) DBQueryOneResult ¶
func (mgr *MongoDBMgr) DBQueryOneResult(collection string, cond interface{}, result map[string]interface{}) error
func (*MongoDBMgr) GetDbSession ¶
func (mgr *MongoDBMgr) GetDbSession() *mgo.Session
func (*MongoDBMgr) Insert ¶
func (mgr *MongoDBMgr) Insert(collection string, doc interface{}) error
func (*MongoDBMgr) Ping ¶
func (mgr *MongoDBMgr) Ping() error
func (*MongoDBMgr) RefreshSession ¶
func (mgr *MongoDBMgr) RefreshSession()
func (*MongoDBMgr) RemoveAll ¶
func (mgr *MongoDBMgr) RemoveAll(collection string, cond interface{}) error
func (*MongoDBMgr) RemoveOne ¶
func (mgr *MongoDBMgr) RemoveOne(collection string, condName string, condValue int64) error
func (*MongoDBMgr) RemoveOneByCond ¶
func (mgr *MongoDBMgr) RemoveOneByCond(collection string, cond interface{}) error
func (*MongoDBMgr) SetMode ¶
func (mgr *MongoDBMgr) SetMode(mode int, refresh bool)
func (*MongoDBMgr) Start ¶
func (mgr *MongoDBMgr) Start() error
func (*MongoDBMgr) Update ¶
func (mgr *MongoDBMgr) Update(collection string, cond interface{}, change interface{}) error
func (*MongoDBMgr) UpdateInsert ¶
func (mgr *MongoDBMgr) UpdateInsert(collection string, cond interface{}, doc interface{}) error
Click to show internal directories.
Click to hide internal directories.