Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SecretKey = "glue.xdb12345678"
默认数据库环境变量加密key
View Source
var SecretMode = "cbc/pkcs7"
Functions ¶
func DecryptConn ¶ added in v0.1.5
Types ¶
type Config ¶
type Config struct { Proto string `json:"proto" valid:"required"` Conn string `json:"conn" valid:"required" label:"连接字符串"` MaxOpen int `json:"max_open" valid:"required" label:"最大打开连接数"` MaxIdle int `json:"max_idle" valid:"required" label:"最大空闲连接数"` LifeTime int `json:"life_time" valid:"required" label:"单个连接时长(秒)"` ShowQueryLog bool `json:"show_query_log" label:"开启慢查询日志"` LongQueryTime int `json:"long_query_time" label:"慢查询阈值(毫秒)"` LoggerName string `json:"logger_name" label:"日志提供程序"` Debug bool `json:"debug" label:"调试模式"` // contains filtered or unexported fields }
DB 数据库配置
type Option ¶
type Option func(*Config)
Option 配置选项
func WithLifeTime ¶
func WithLoggerName ¶ added in v0.1.31
func WithLongQueryTime ¶
func WithMaxIdle ¶
func WithMaxOpen ¶
func WithShowQueryLog ¶
Click to show internal directories.
Click to hide internal directories.