db

package
v0.0.0-...-9493ce7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDB

type MongoDB struct {
	// contains filtered or unexported fields
}

MongoDB 数据库

func GetMongoDBInstance

func GetMongoDBInstance() *MongoDB

GetMongoDBInstance 获取单例

func (*MongoDB) InitializeWithTimeout

func (object *MongoDB) InitializeWithTimeout(timeout time.Duration) (err error)

InitializeWithTimeout 初始化

func (*MongoDB) WithCollection

func (object *MongoDB) WithCollection(db, c string, callback func(c *mgo.Collection))

WithCollection 获取集合

func (*MongoDB) WithDefaultDBCollection

func (object *MongoDB) WithDefaultDBCollection(c string, callback func(c *mgo.Collection))

WithDefaultDBCollection 获取默认数据库集合

type MySQL

type MySQL struct {
	DB *gorm.DB
}

MySQL

func GetMySQLInstance

func GetMySQLInstance() *MySQL

GetMySQLInstance 获取单实例

func (*MySQL) Initialize

func (object *MySQL) Initialize() (err error)

初始化

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL