Documentation
¶
Index ¶
- Constants
- 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(wheres []*WhereWrapper) func(db *gorm.DB) *gorm.DB
- func Where(wheres []*WhereWrapper) func(db *gorm.DB) *gorm.DB
- type AutoMigrate
- 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 MySQL
- 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
- type WhereWrapper
Constants ¶
View Source
const ( ConditionTypeLte = "<=" ConditionTypeLt = "<" ConditionTypeGte = ">=" ConditionTypeGt = ">" ConditionTypeEq = "=" ConditionTypeIn = "in" )
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 ¶
type WhereWrapper ¶
func NewWhereWrapper ¶
func NewWhereWrapper(col string, condition string, val interface{}) *WhereWrapper
func Wrappers ¶
func Wrappers(conditions ...*WhereWrapper) []*WhereWrapper
Click to show internal directories.
Click to hide internal directories.