Documentation
¶
Index ¶
- Constants
- Variables
- func AddDataStore(dn string, value interface{}) interface{}
- func Debug(f string, msgs ...string)
- func GetDataStore(dn string) (interface{}, error)
- func Setup(dss []map[string]interface{}, autoconnect bool) error
- func String() string
- type Collection
- type Mds
- type MongoDB
- func (m *MongoDB) Connect() error
- func (m *MongoDB) CopySession() (*mgo.Session, error)
- func (m *MongoDB) GetCollection(colname string, makeSession bool) (*Collection, error)
- func (m *MongoDB) GetCollectionWithoutErr(colname string, makeSession bool, exit bool) *Collection
- func (m *MongoDB) GetDataBase(dbname string, makeSession bool) (*mgo.Database, error)
- func (m *MongoDB) GetSession(makeSession bool) (*mgo.Session, error)
- func (m *MongoDB) String() string
- type MongoDBOption
Constants ¶
View Source
const ( // mds version VERSION = "0.0.1" // type: MongoDB MONGODB = "MongoDB" )
Variables ¶
View Source
var DEBUG = false
Debug flag
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
*mgo.Collection
Session *mgo.Session `json:"-" bson:"-"`
}
Mongodb#Collection
type MongoDB ¶
type MongoDB struct {
Use bool
Dn string
Type string
DialInfo *mgo.DialInfo
Session *mgo.Session
Connected bool
}
MongoDB
func GetDataStoreMongoDB ¶
Get the Mongodb datastore
func (*MongoDB) CopySession ¶
Get a new session
func (*MongoDB) GetCollection ¶
func (m *MongoDB) GetCollection(colname string, makeSession bool) (*Collection, error)
Get Collection
func (*MongoDB) GetCollectionWithoutErr ¶
func (m *MongoDB) GetCollectionWithoutErr(colname string, makeSession bool, exit bool) *Collection
Get Collection without any errors if exit == true, shutdown this application immediatry.
func (*MongoDB) GetDataBase ¶
Get Database
func (*MongoDB) GetSession ¶
Get a session (Singleton)
type MongoDBOption ¶
get options
Click to show internal directories.
Click to hide internal directories.