Documentation ¶
Index ¶
- func GetBaseConfig(c framework.Container) *contract.DBConfig
- func NewYgoGorm(params ...interface{}) (interface{}, error)
- func WithConfigPath(configPath string) contract.DBOption
- func WithDryRun() contract.DBOption
- func WithFullSaveAssociations() contract.DBOption
- func WithGormConfig(gormConfig *gorm.Config) contract.DBOption
- type GormProvider
- type OrmLogger
- func (o *OrmLogger) Error(ctx context.Context, s string, i ...interface{})
- func (o *OrmLogger) Info(ctx context.Context, s string, i ...interface{})
- func (o *OrmLogger) LogMode(level logger.LogLevel) logger.Interface
- func (o *OrmLogger) Trace(ctx context.Context, begin time.Time, ...)
- func (o *OrmLogger) Warn(ctx context.Context, s string, i ...interface{})
- type YgoGorm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBaseConfig ¶
GetBaseConfig 读取database.yaml根目录结构
func WithConfigPath ¶
WithConfigPath 加载配置文件地址
func WithFullSaveAssociations ¶
WithFullSaveAssociations 设置保存时候关联
Types ¶
type GormProvider ¶
type GormProvider struct { }
GormProvider 提供App的具体实现方法
func (*GormProvider) Boot ¶
func (h *GormProvider) Boot(container framework.Container) error
Boot 启动调用
func (*GormProvider) Params ¶
func (h *GormProvider) Params(container framework.Container) []interface{}
Params 获取初始化参数
func (*GormProvider) Register ¶
func (h *GormProvider) Register(container framework.Container) framework.NewInstance
Register 注册方法
type OrmLogger ¶
type OrmLogger struct {
// contains filtered or unexported fields
}
OrmLogger orm的日志实现类, 实现了gorm.Logger.Interface
Click to show internal directories.
Click to hide internal directories.