Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBOper ¶
type DBOper interface { DB(ctx context.Context) *gorm.DB Transactional(ctx context.Context, fn func(ctx context.Context) error) error }
DBOper -
type RedisOper ¶
type RedisOper interface { // Conn - Get a redis connection from the pool. // The application must close the returned connection. Conn() redis.Conn GetString(key string) (string, error) SetString(key, value string) error SetStringOpts(key, value string, setnx bool, setxx bool, ttl time.Duration) error GetObject(key string, model interface{}) (interface{}, error) SetObject(key string, value interface{}) error SetObjectOpts(key string, value interface{}, setnx bool, setxx bool, ttl time.Duration) error Unlink(key string) error Unlinks(keys ...string) error Delete(key string) error Deletes(keys ...string) error DeleteByKeyValue(key string, val string) error }
RedisOper -
type RedisPool ¶
RedisPool -
func MustNewRedisPool ¶
func MustNewRedisPool(redisConfig *nconf.RedisConfig) RedisPool
MustNewRedisPool -
func NewRedisPool ¶
func NewRedisPool(redisConfig *nconf.RedisConfig) (RedisPool, error)
NewRedisPool -
Click to show internal directories.
Click to hide internal directories.