mysql

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mysql is the mysql instance builder.

Index

Constants

View Source
const (
	Silent glogger.LogLevel = iota + 1
	Error
	Warn
	Info
)

Define gorm log levels.

Variables

This section is empty.

Functions

func NewMysqlIns added in v0.1.7

func NewMysqlIns() (*gorm.DB, error)

NewMysqlIns creates a gorm db instance.

Types

type MysqlOptions

type MysqlOptions struct {
	Addr            string
	Username        string
	Password        string
	Database        string
	MaxIdleConns    int           `mapstructure:"max-idle-conns"`
	MaxOpenConns    int           `mapstructure:"max-open-conns"`
	MaxConnLifeTime time.Duration `mapstructure:"max-connection-life-time"`
	SlowThreshold   time.Duration `mapstructure:"slow-threshold"`
	LogLevel        int           `mapstructure:"log-level"`
}

MysqlOptions defines options for building a mysql instance.

Jump to

Keyboard shortcuts

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