config

package
v0.1.13-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBConnect = DataBaseConnect{MaxIdleConns: 10, MaxOpenConns: 100, ConnMaxLifetime: 3600}
View Source
var DBlog = DataBaselog{SlowThreshold: 1, LogLevel: 3, IgnoreRecordNotFoundError: true, Colorful: true}

Functions

This section is empty.

Types

type DataBaseConnect

type DataBaseConnect struct {
	DBConnectString string //连接字符串
	MaxIdleConns    int    //空闲连接池中连接的最大数量
	MaxOpenConns    int    //打开数据库连接的最大数量
	ConnMaxLifetime int    //连接可复用的最大时间(分钟)
}

type DataBaselog

type DataBaselog struct {
	SlowThreshold             int64 //慢SQL阈值(秒)
	LogLevel                  int   //日志级别 1:Silent  2:Error 3:Warn 4:Info
	IgnoreRecordNotFoundError bool  //忽略ErrRecordNotFound(记录未找到)错误
	Colorful                  bool  //使用彩色打印
}

Jump to

Keyboard shortcuts

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