Documentation ¶
Index ¶
- Variables
- func GetCol(dbName, col string) (session *mgo.Session, collection *mgo.Collection)
- func IsFinishInit() bool
- func IsMgoDup(err error) bool
- func IsMgoNotFound(err error) bool
- func NewCollection(session *mgo.Session, dbName, name string) *mgo.Collection
- func NewObjectId() bson.ObjectId
- func NewSession() (session *mgo.Session)
- func ObjectIds(ids []string) (ret []bson.ObjectId)
- func SetOnFinishInit(f func())
- func Setup(c *MongoConfig)
- func ShareSession() *mgo.Session
- type M
- type MongoConfig
- type SqlServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOperaBeforeInit = errors.New("please set db.SetOnFinishInit when needed operating db in init()")
Functions ¶
func IsFinishInit ¶
func IsFinishInit() bool
func IsMgoNotFound ¶
func NewCollection ¶
func NewCollection(session *mgo.Session, dbName, name string) *mgo.Collection
func NewObjectId ¶
func NewSession ¶
func NewSession() (session *mgo.Session)
func SetOnFinishInit ¶
func SetOnFinishInit(f func())
func Setup ¶
func Setup(c *MongoConfig)
func ShareSession ¶
func ShareSession() *mgo.Session
Types ¶
type MongoConfig ¶
Click to show internal directories.
Click to hide internal directories.