orm

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gorm

func Gorm(options ...gorm.Option) dio.PluginConfig

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

func (GormLogger) Trace

func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

Trace print sql message

func (GormLogger) Warn

func (l GormLogger) Warn(ctx context.Context, msg string, data ...interface{})

Warn print warn messages

type GormOptions

type GormOptions struct {
	Options []gorm.Option
}

func (*GormOptions) BeanName

func (c *GormOptions) BeanName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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