database

package
v0.0.0-...-6e4d488 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Discard = New(log.New(ioutil.Discard, "", log.LstdFlags), config{})
	Default = New(log.New(os.Stdout, "\r\n", log.LstdFlags), config{
		SlowThreshold: 200 * time.Millisecond,
		LogLevel:      logger.Warn,
		Colorful:      true,
	})
	Recorder = traceRecorder{Interface: Default, BeginAt: time.Now()}
)

Functions

func GormMysql

func GormMysql() *gorm.DB

GormMysql 初始化Mysql数据库

func Instance

func Instance() *gorm.DB

Instance 数据库单例

func MysqlTables

func MysqlTables(db *gorm.DB)

MysqlTables 注册数据库表专用

func New

func New(writer writer, config config) logger.Interface

Types

type InitDBFunc

type InitDBFunc interface {
	Init() (err error)
}

InitDBFunc 数据化初始化接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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