Documentation ¶
Index ¶
- func AddGormHook(hook GobaseGormHook)
- func AddXormHook(hook GobaseXormHook)
- func NewGormDb() (*gorm.DB, error)
- func NewGormDbWitConfig(gormConfig *gorm.Config) (*gorm.DB, error)
- func NewGormDbWithName(datasourceName string) (*gorm.DB, error)
- func NewGormDbWithNameAndConfig(datasourceName string, gormConfig *gorm.Config) (*gorm.DB, error)
- func NewXormDb() (*xorm.Engine, error)
- func NewXormDbMasterSlave(masterDatasourceName string, slaveDatasourceNames []string, ...) (*xorm.EngineGroup, error)
- func NewXormDbWithName(datasourceName string) (*xorm.Engine, error)
- func NewXormDbWithNameParams(datasourceName string, params map[string]string) (*xorm.Engine, error)
- func NewXormDbWithParams(params map[string]string) (*xorm.Engine, error)
- func WrapDriverName(driverName string) string
- type DefaultXormHook
- type GobaseGormHook
- type GobaseSqlHookProxy
- func (proxy *GobaseSqlHookProxy) After(ctx context.Context, query string, args ...interface{}) (context.Context, error)
- func (proxy *GobaseSqlHookProxy) Before(ctx context.Context, query string, args ...interface{}) (context.Context, error)
- func (proxy *GobaseSqlHookProxy) OnError(ctx context.Context, err error, query string, args ...interface{}) error
- type GobaseXormHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGormHook ¶
func AddGormHook(hook GobaseGormHook)
func AddXormHook ¶
func AddXormHook(hook GobaseXormHook)
func NewXormDbMasterSlave ¶
func NewXormDbMasterSlave(masterDatasourceName string, slaveDatasourceNames []string, policies ...xorm.GroupPolicy) (*xorm.EngineGroup, error)
func NewXormDbWithNameParams ¶
func WrapDriverName ¶
Types ¶
type DefaultXormHook ¶
type DefaultXormHook struct {
// contains filtered or unexported fields
}
func (*DefaultXormHook) AfterProcess ¶
func (defaultHook *DefaultXormHook) AfterProcess(c *contexts.ContextHook) error
func (*DefaultXormHook) BeforeProcess ¶
func (defaultHook *DefaultXormHook) BeforeProcess(c *contexts.ContextHook) (context.Context, error)
type GobaseGormHook ¶
type GobaseGormHook interface { Before(ctx context.Context, driverName string, parameters map[string]any) (context.Context, error) After(ctx context.Context, driverName string, parameters map[string]any) (context.Context, error) Err(ctx context.Context, driverName string, err error, parameters map[string]any) error }
type GobaseSqlHookProxy ¶
type GobaseSqlHookProxy struct {
DriverName string
}
type GobaseXormHook ¶
type GobaseXormHook interface { BeforeProcess(c *contexts.ContextHook, driverName string) (context.Context, error) AfterProcess(c *contexts.ContextHook, driverName string) error }
Click to show internal directories.
Click to hide internal directories.