Documentation ¶
Index ¶
- func Gorm(options ...gorm.Option) dio.PluginConfig
- type GormConfiguration
- type GormLogger
- func (l *GormLogger) AfterPropertiesSet()
- func (l *GormLogger) BeanConstruct()
- func (l *GormLogger) BeanName() string
- func (l GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (l GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
- type GormOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GormConfiguration ¶
type GormConfiguration struct { Username string `value:"gorm.username"` Password string `value:"gorm.password"` Host string `value:"gorm.host"` Port int `value:"gorm.port"` Database string `value:"gorm.database"` Parameters string `value:"gorm.parameters"` MaxIdle int `value:"gorm.pool.max-idle"` MaxOpen int `value:"gorm.pool.max-open"` MaxLifeTime string `value:"gorm.pool.max-life-time"` MaxIdleTime string `value:"gorm.pool.max-idle-time"` Logger *GormLogger `aware:""` Log *system.Log `aware:""` // contains filtered or unexported fields }
func (*GormConfiguration) AfterPropertiesSet ¶
func (c *GormConfiguration) AfterPropertiesSet(container di.DI)
AfterPropertiesSet 注入完成时触发
func (*GormConfiguration) BeanConstruct ¶
func (c *GormConfiguration) BeanConstruct(container di.DI)
func (*GormConfiguration) BeanName ¶
func (c *GormConfiguration) BeanName() string
type GormLogger ¶
type GormLogger struct { Level int `value:"gorm.log.level"` SlowThreshold string `value:"gorm.log.slow-log"` IgnoreRecordNotFoundError bool `value:"gorm.log.ignore-notfound"` Log *system.Log `aware:""` // contains filtered or unexported fields }
func (*GormLogger) AfterPropertiesSet ¶
func (l *GormLogger) AfterPropertiesSet()
AfterPropertiesSet 注入完成时触发
func (*GormLogger) BeanConstruct ¶
func (l *GormLogger) BeanConstruct()
func (*GormLogger) BeanName ¶
func (l *GormLogger) BeanName() string
func (GormLogger) Error ¶
func (l GormLogger) Error(ctx context.Context, msg string, data ...interface{})
Error print error messages
func (GormLogger) Info ¶
func (l GormLogger) Info(ctx context.Context, msg string, data ...interface{})
Info print info
func (*GormLogger) LogMode ¶
func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
LogMode log mode
type GormOptions ¶
func (*GormOptions) BeanName ¶
func (c *GormOptions) BeanName() string
Click to show internal directories.
Click to hide internal directories.