db

package
v0.0.0-...-b66827d Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config    *config.Config
	MysqlConn *gorm.DB
	RedisConn *redis.Client
)

Functions

func CloseDB

func CloseDB()

func ConnClose

func ConnClose()

关闭连接池

func InitDB

func InitDB(mysqlDbd ...AutoDB)

func MysqlConnet

func MysqlConnet(mysqlDB ...AutoDB)

func Redis

func Redis(dbNum int) *redis.Client

func RedisConnet

func RedisConnet()

func RedisSorce

func RedisSorce(DBNum int)

Types

type AutoDB

type AutoDB func(db *gorm.DB)

type GormModel

type GormModel struct {
	CreatedAt time2.Time
	UpdatedAt time2.Time
	DeletedAt *time2.Time `sql:"index"`
}

type TimeStampModel

type TimeStampModel struct {
	CreatedAt int64       `gorm:"column:created_at" json:"created_at" `
	UpdatedAt int64       `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt *time2.Time `gorm:"column:deleted_at" json:"deleted_at" sql:"index"`
}

Jump to

Keyboard shortcuts

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