mysql

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) *gorm.DB

====================== 业务板块 ======================

func MainDB

func MainDB() *gorm.DB

Types

type Instance

type Instance struct {
	Items map[string]connCfg `yaml:"items"`
}

func (*Instance) GetName

func (i *Instance) GetName() string

func (*Instance) Run

func (i *Instance) Run() error

type MySqlLogger

type MySqlLogger struct {
	gormLogger.Config
	ZLogger zerolog.Logger
	// contains filtered or unexported fields
}

func NewMysqlLogger

func NewMysqlLogger(zlog zerolog.Logger, config gormLogger.Config) *MySqlLogger

============================================================ * * 功能:整合 zerologger 到 mysql 中 * 自定义 日志 风格格式 * ============================================================

func (*MySqlLogger) Error

func (l *MySqlLogger) Error(ctx context.Context, msg string, data ...interface{})

func (*MySqlLogger) Info

func (l *MySqlLogger) Info(ctx context.Context, msg string, data ...interface{})

func (*MySqlLogger) LogMode

实现 mysql 的日志 信息接口

func (*MySqlLogger) Trace

func (l *MySqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*MySqlLogger) Warn

func (l *MySqlLogger) Warn(ctx context.Context, msg string, data ...interface{})

Jump to

Keyboard shortcuts

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