Documentation
¶
Index ¶
- func Chk(err error, entries ...*logrus.Entry)
- func CleanLoop(query *gorm.DB, dest interface{}, batchSize int, hdl Hdl, thresholds ...int) error
- func ConnectToPG(conn string, opts ...Option) (*gorm.DB, error)
- func DockerPg(version ...string) (string, func())
- func Dup(err error) bool
- func Exist(db *gorm.DB) (bool, error)
- func NewGormLogger() gormlogger.Interface
- func NotFound(err error) bool
- type Hdl
- type Lg
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerPg ¶
DockerPg 测试辅助函数。 利用 dockertest 生成一次性pg实例。 version , 可选参数,用于指定pg版本, 默认为 "13" 返回 gorm 连接字符串, 以及用于清理此pg实例的 cleanup 函数
func NewGormLogger ¶
func NewGormLogger() gormlogger.Interface
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option 是一个连接选项 interface.
func WithConnMaxLifetime ¶
WithConnMaxLifetime sets the maximum amount of time a connection may be reused.
func WithMaxIdleConns ¶
WithMaxIdleConns sets the maximum number of connections in the idle connection pool.
func WithMaxOpenConns ¶
WithMaxOpenConns sets the maximum number of open connections to the database.
Click to show internal directories.
Click to hide internal directories.