Versions in this module Expand all Collapse all v0 v0.7.0 Apr 22, 2024 v0.6.0 Jan 11, 2024 Changes in this version + func MustNewDB(dbConfig *nconf.DbConfig, opt ...DBOption) *gorm.DB + func NewDB(dbConfig *nconf.DbConfig, opt ...DBOption) (*gorm.DB, error) + type DBOper interface + DB func(ctx context.Context) *gorm.DB + Transactional func(ctx context.Context, fn func(ctx context.Context) error) error + func NewDBOper(db *gorm.DB) DBOper + type DBOption func(*dbOptions) + func DialectorOption(dialector gorm.Dialector) DBOption + type RedisOper interface + Conn func() redis.Conn + Delete func(key string) error + DeleteByKeyValue func(key string, val string) error + Deletes func(keys ...string) error + GetObject func(key string, model interface{}) (interface{}, error) + GetString func(key string) (string, error) + SetObject func(key string, value interface{}) error + SetObjectOpts func(key string, value interface{}, setnx bool, setxx bool, ttl time.Duration) error + SetString func(key, value string) error + SetStringOpts func(key, value string, setnx bool, setxx bool, ttl time.Duration) error + Unlink func(key string) error + Unlinks func(keys ...string) error + func NewRedisOper(redisPool RedisPool) RedisOper + type RedisPool interface + Close func() error + Get func() redis.Conn + func MustNewRedisPool(redisConfig *nconf.RedisConfig) RedisPool + func NewRedisPool(redisConfig *nconf.RedisConfig) (RedisPool, error) + type Transactional func(ctx context.Context, fn func(ctx context.Context) error) error