mysql

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMasterDB

func GetMasterDB() *gorm.DB

func InitMySQL

func InitMySQL()

Types

type Config

type Config struct {
	Host         string `json:"host"`
	Port         int    `json:"port"`
	Database     string `json:"database"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	MaxIdleConns int    `json:"maxIdleConns"`
	MaxOpenConns int    `json:"maxOpenConns"`
}

type Logger

type Logger struct {
	*logit.Helper
	logger.Config
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(helper *logit.Helper, config logger.Config) *Logger

func (*Logger) Error

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

func (*Logger) Info

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

func (*Logger) LogMode

func (l *Logger) LogMode(level logger.LogLevel) logger.Interface

func (*Logger) Trace

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

func (*Logger) Warn

func (l *Logger) 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