Documentation ¶
Overview ¶
Created by guoxin in 2023/12/12 16:44
Created by guoxin in 2023/12/12 17:59
Index ¶
- func GetRedisClient(conf zeroredis.RedisConf) (*redis.Client, error)
- func NewCacheFromClusterConf(conf kv.KvConf) (*cache.Gorm2Cache, error)
- func NewCacheFromRedisConf(conf CacheConf, getCli func(zeroredis.RedisConf) (*redis.Client, error)) (*cache.Gorm2Cache, error)
- func NewGorm(conf DBConf, plugins ...gorm.Plugin) (*gorm.DB, error)
- func NewGormCache(conf DBConf, getCli func(zeroredis.RedisConf) (*redis.Client, error)) (*gorm.DB, error)
- func NewGormFromDialector(dialector gorm.Dialector, plugins ...gorm.Plugin) (*gorm.DB, error)
- type CacheConf
- type DBConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCacheFromClusterConf ¶
func NewCacheFromClusterConf(conf kv.KvConf) (*cache.Gorm2Cache, error)
func NewCacheFromRedisConf ¶
func NewGorm ¶
NewGorm @Description: 创建DB @param conf @param plugins @return *gorm.DB @return error
Types ¶
type CacheConf ¶
type CacheConf struct { Redis zeroredis.RedisConf `json:","` Tables []string `json:",optional"` CacheTTL int64 `json:",optional"` // config.CacheLevelOff // config.CacheLevelOnlyPrimary // config.CacheLevelOnlySearch // config.CacheLevelAll Level int `json:",optional"` // config.CacheStorageMemory // config.CacheStorageRedis Storage int `json:",optional"` }
Click to show internal directories.
Click to hide internal directories.