db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterCreate

func AfterCreate(db *gorm.DB)

func MongoClient

func MongoClient(cfg configs.Mongodb) driver.Client

func NewMysql

func NewMysql(cfg configs.MysqlConfig) *gorm.DB

func NewRedis

func NewRedis(cfg configs.RedisConfig) *redis.Client

Types

type DataSource

type DataSource struct {
	Mysql   *gorm.DB
	Mongodb driver.Client
	Redis   *redis.Client
}

DataSource 在使用多个db的项目中在DataSource结构体中增加Engine即可

func NewDataSource

func NewDataSource(cfg configs.Config) *DataSource

Jump to

Keyboard shortcuts

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