Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db interface { Connect(hosts, db string) error //连接 OpenDb(db string) error //打开库 OpenTable(table string) //开打表 Query(query interface{}) error //查询 Insert(docs ...interface{}) error //写入 Close() error //关闭连接 }
Db 定义了一个对存储操作的接口
type MongoClient ¶
Mongo 定义mongo 操作实例
func (*MongoClient) C ¶
func (m *MongoClient) C()
func (*MongoClient) Close ¶
func (m *MongoClient) Close()
func (*MongoClient) Connect ¶
func (m *MongoClient) Connect() error
func (*MongoClient) DB ¶
func (m *MongoClient) DB()
func (*MongoClient) GetCollection ¶
func (m *MongoClient) GetCollection() *mgo.Collection
type MongoGridfs ¶
type MongoGridfs struct { MongoClient GridFS *mgo.GridFS }
func (*MongoGridfs) C ¶
func (m *MongoGridfs) C()
func (*MongoGridfs) GetGridFs ¶
func (m *MongoGridfs) GetGridFs() *mgo.GridFS
Click to show internal directories.
Click to hide internal directories.