Documentation
¶
Index ¶
- func FilterDeleted() func(db *gorm.DB) *gorm.DB
- func NewKidLogger(config *gLogger.Config) gLogger.Interface
- func Paginate(pageNum, pageSize int) func(db *gorm.DB) *gorm.DB
- func Search(where map[string]interface{}) func(db *gorm.DB) *gorm.DB
- func Where(where map[string]interface{}) func(db *gorm.DB) *gorm.DB
- type AutoMigrate
- type DB
- type KidLogger
- func (log *KidLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (log *KidLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (log *KidLogger) LogMode(level gLogger.LogLevel) gLogger.Interface
- func (log *KidLogger) Trace(ctx context.Context, begin time.Time, ...)
- func (log *KidLogger) Warn(ctx context.Context, msg string, data ...interface{})
- type Option
- func WithDb(dbName string) Option
- func WithHost(host string) Option
- func WithLogLevel(logLevel int) Option
- func WithMaxIdle(maxIdle int) Option
- func WithMaxLife(maxLife time.Duration) Option
- func WithMaxOpen(maxOpen int) Option
- func WithPassword(password string) Option
- func WithPort(port int) Option
- func WithUser(user string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutoMigrate ¶
type AutoMigrate interface {
Models() []interface{}
}
type Option ¶
type Option func(*Options)
func WithLogLevel ¶
func WithMaxIdle ¶
func WithMaxLife ¶
func WithMaxOpen ¶
func WithPassword ¶
Click to show internal directories.
Click to hide internal directories.