Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRecordNotFound = gorm.ErrRecordNotFound ErrInvalidTransaction = gorm.ErrInvalidTransaction ErrMissingWhereClause = gorm.ErrMissingWhereClause )
Functions ¶
This section is empty.
Types ¶
type Association ¶
type Association = gorm.Association
type Config ¶
type Config struct { Name string `json:"name" yaml:"name"` //配置名称 Address string `json:"address" yaml:"address"` //mysql地址 DBName string `json:"dbName" yaml:"dbName"` //数据库名 User string `json:"user" yaml:"user"` //用户名 Password string `json:"password" yaml:"password"` //密码 Charset string `json:"charset" yaml:"charset"` //数据库字符集 DialTimeout time.Duration `json:"dialTimeout" yaml:"dialTimeout"` //超时时间 单位:秒 MaxOpen int `json:"maxOpen" yaml:"maxOpen"` //最大连接数 MaxIdle int `json:"maxIdle" yaml:"maxIdle"` //最大空闲数 ConnMaxLifetime time.Duration `json:"connMaxLifetime" yaml:"connMaxLifetime"` //连接的最大存活时间 单位:秒 SlowThreshold time.Duration `json:"slowThreshold" yaml:"slowThreshold"` //慢日志阈值 单位:毫秒 Debug bool `json:"debug" yaml:"debug"` //是否打印调试日志 DisableTrace bool `json:"disableTrace" yaml:"disableTrace"` //是否进行链路追踪 }
func DefaultConfig ¶
func DefaultConfig() Config
type TracePlugin ¶
type TracePlugin struct{}
func (*TracePlugin) Initialize ¶
func (tr *TracePlugin) Initialize(db *xgorm.DB) (err error)
func (*TracePlugin) Name ¶
func (tr *TracePlugin) Name() string
Click to show internal directories.
Click to hide internal directories.