Documentation ¶
Index ¶
- func GetGorm(name string) *gorm.DB
- func GetMongoCollection(dbName, collection string) *mongo.Collection
- func GetMongoDB(dbName string) *mongo.Database
- func InitMysqlDriver()
- func InitMysqlGorm()
- func MongoConn() *mongo.Client
- func RedisConn() *redis.Pool
- type MongoCollection
- func (mo *MongoCollection) DeleteMany(filter interface{}) (err error)
- func (mo *MongoCollection) FindOne(filter, result interface{}) (err error)
- func (mo *MongoCollection) Get() *mongo.Collection
- func (mo *MongoCollection) InsertMany(value []interface{}) (err error)
- func (mo *MongoCollection) InsertOne(value interface{}) (err error)
- func (mo *MongoCollection) UpdateOne(filter, update interface{}) (err error)
- type MysqlDriver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMongoCollection ¶
func GetMongoCollection(dbName, collection string) *mongo.Collection
func GetMongoDB ¶
func InitMysqlDriver ¶
func InitMysqlDriver()
func InitMysqlGorm ¶
func InitMysqlGorm()
Types ¶
type MongoCollection ¶
type MongoCollection struct { DataBase string Collection string Conn *mongo.Collection }
func NewMongoCollection ¶
func NewMongoCollection(dbName, collection string) *MongoCollection
func (*MongoCollection) DeleteMany ¶
func (mo *MongoCollection) DeleteMany(filter interface{}) (err error)
func (*MongoCollection) FindOne ¶
func (mo *MongoCollection) FindOne(filter, result interface{}) (err error)
func (*MongoCollection) Get ¶
func (mo *MongoCollection) Get() *mongo.Collection
func (*MongoCollection) InsertMany ¶
func (mo *MongoCollection) InsertMany(value []interface{}) (err error)
func (*MongoCollection) InsertOne ¶
func (mo *MongoCollection) InsertOne(value interface{}) (err error)
func (*MongoCollection) UpdateOne ¶
func (mo *MongoCollection) UpdateOne(filter, update interface{}) (err error)
type MysqlDriver ¶
func GetMysqlDriver ¶
func GetMysqlDriver(dbName string) *MysqlDriver
func NewMysqlDriver ¶
func NewMysqlDriver(database, user, password, host string) (*MysqlDriver, error)
func (*MysqlDriver) SetMaxIdleConn ¶
func (m *MysqlDriver) SetMaxIdleConn(number int)
SetMaxIdleConn
func (*MysqlDriver) SetMaxOpenConn ¶
func (m *MysqlDriver) SetMaxOpenConn(number int)
SetMaxOpenConn
Click to show internal directories.
Click to hide internal directories.