Versions in this module Expand all Collapse all v0 v0.3.6 Nov 12, 2024 Changes in this version + type GormCache struct + Cache cache.Cache + Conf cache.CacheConf + Db *gorm.DB v0.3.5 Nov 11, 2024 Changes in this version type CacheTool + Conf cache.CacheConf + func (m *CacheTool) ClearRedisPrefix(keyPrefix string) v0.3.3 Nov 7, 2024 Changes in this version + func CreateBeforeHook(gormDB *gorm.DB) + func GetSqlDriver(conf Conf) (*gorm.DB, error) + func MaskNotDataError(gormDB *gorm.DB) + func Paginate(page int, pageSize int) func(db *gorm.DB) *gorm.DB + func UpdateBeforeHook(gormDB *gorm.DB) + type Base struct + CreatedAt time.Time + Id int64 + UpdatedAt time.Time + type BaseDel struct + CreatedAt time.Time + DeletedAt soft_delete.DeletedAt + Id int64 + UpdatedAt time.Time + type CacheTool struct + Cache cache.Cache + Db *gorm.DB + func NewCacheTool(conf cache.CacheConf, db *gorm.DB) *CacheTool + func (m *CacheTool) CreateUpdate(model any, callBack TodoCallback) (int64, error) + func (m *CacheTool) Delete(model any, callBack TodoCallback) (int64, error) + func (m *CacheTool) FormatPrimary(keyPrefix string, primary any) string + func (m *CacheTool) Select(key string, callBack SelectCallback) (any, error) + type Client struct + Conf Conf + GormDb *gorm.DB + func MustNewClient(conf Conf) *Client + func NewClient(conf Conf) (*Client, error) + type Conf struct + IsOpenReadDb bool + Read ConfigParamsDetail + SlowThreshold int + SqlType SqlTypeEnum + Write ConfigParamsDetail + type ConfigParamsDetail struct + Charset string + DataBase string + Host string + Pass string + Port int + Prefix string + SetConnMaxLifetime int + SetMaxIdleConn int + SetMaxOpenConn int + User string + type OptionFunc func(log *logger) + type Options interface + func SetErrStrFormat(format string) Options + func SetInfoStrFormat(format string) Options + func SetTracErrStrFormat(format string) Options + func SetTracWarnStrFormat(format string) Options + func SetTraceStrFormat(format string) Options + func SetWarnStrFormat(format string) Options + type SelectCallback func(key string) (any, error) + type SqlTypeEnum int + const MysqlType + const PostgresqlType + const SqlServerType + type TodoCallback func(model any) (int64, error) v0.3.2 Nov 7, 2024 v0.3.1 Nov 7, 2024 v0.3.0 Nov 5, 2024 v0.2.3 Nov 3, 2024 v0.2.2 Nov 3, 2024