Documentation ¶
Index ¶
- func GetBaseConfig(c framework.Container) *contract.DBConfig
- func NewNiceGorm(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 LoggerORM
- func (o *LoggerORM) Error(ctx context.Context, s string, i ...interface{})
- func (o *LoggerORM) Info(ctx context.Context, s string, i ...interface{})
- func (o *LoggerORM) LogMode(level logger.LogLevel) logger.Interface
- func (o *LoggerORM) Trace(ctx context.Context, begin time.Time, ...)
- func (o *LoggerORM) Warn(ctx context.Context, s string, i ...interface{})
- type NiceGorm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBaseConfig ¶
GetBaseConfig 读取database.yaml根目录结构
func NewNiceGorm ¶
func NewNiceGorm(params ...interface{}) (interface{}, error)
NewNiceGorm 代表实例化Gorm
func WithConfigPath ¶
WithConfigPath 加载配置文件地址
func WithFullSaveAssociations ¶
WithFullSaveAssociations 设置保存时候关联
Types ¶
type GormProvider ¶
type GormProvider struct {
// contains filtered or unexported fields
}
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 LoggerORM ¶
type LoggerORM struct {
// contains filtered or unexported fields
}
LoggerORM orm的日志实现类, 实现了gorm.Logger.Interface
Click to show internal directories.
Click to hide internal directories.