db

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisClient *redis.Client

Functions

func InitRedis added in v1.0.9

func InitRedis(cfg config.Configuration)

初始化redis连接

Types

type MySqlPool

type MySqlPool struct{}

func GetInstance

func GetInstance() *MySqlPool

单例模式

func (*MySqlPool) CloseDB added in v1.0.9

func (pool *MySqlPool) CloseDB() *gorm.DB

关闭连接

func (*MySqlPool) GetDB

func (pool *MySqlPool) GetDB() *gorm.DB

对外获取数据库连接对象db

func (*MySqlPool) InitPool

func (pool *MySqlPool) InitPool(cfg config.Configuration) bool

初始化数据库连接

Jump to

Keyboard shortcuts

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