Documentation ¶
Index ¶
- func DBIsValid(rdb *RedisDB) error
- func IsKeyNotExist(err error) bool
- type Batch
- type KVPair
- type KVPairs
- type RaftRedisClient
- type RedisDB
- func (rdb *RedisDB) Close() error
- func (rdb *RedisDB) Delete(key []byte) error
- func (rdb *RedisDB) DeleteSync(key []byte) error
- func (rdb *RedisDB) Get(key []byte) ([]byte, error)
- func (rdb *RedisDB) Has(key []byte) (bool, error)
- func (rdb *RedisDB) Iterator(start, end []byte) (db.Iterator, error)
- func (rdb *RedisDB) NewBatch() db.Batch
- func (rdb *RedisDB) NewRedisIterator(start, end []byte, isReserve bool, withValue bool, limit int) db.Iterator
- func (rdb *RedisDB) Print() error
- func (rdb *RedisDB) ReverseIterator(start, end []byte) (db.Iterator, error)
- func (rdb *RedisDB) Set(key, value []byte) error
- func (rdb *RedisDB) SetSync(key, value []byte) error
- func (rdb *RedisDB) Stats() map[string]string
- type RedisIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKeyNotExist ¶
Types ¶
type RaftRedisClient ¶
type RaftRedisClient struct {
*redis.Client
}
func NewRaftRedisClient ¶
func NewRaftRedisClient(opt *redis.Options) *RaftRedisClient
func (*RaftRedisClient) GetKeys ¶
func (client *RaftRedisClient) GetKeys(prefix string, desc bool) (KVPairs, error)
获取前缀为 prefix 的所有键值对 desc 为降序返回
type RedisDB ¶
type RedisDB struct { DB *RaftRedisClient // contains filtered or unexported fields }
func NewRedisDB ¶
func NewRedisDB(opt *redis.Options) *RedisDB
func (*RedisDB) DeleteSync ¶
func (*RedisDB) NewRedisIterator ¶
func (*RedisDB) ReverseIterator ¶
type RedisIterator ¶
type RedisIterator struct {
// contains filtered or unexported fields
}
func (*RedisIterator) Close ¶
func (ri *RedisIterator) Close() error
func (*RedisIterator) Domain ¶
func (ri *RedisIterator) Domain() (start, end []byte)
func (*RedisIterator) Error ¶
func (ri *RedisIterator) Error() error
func (*RedisIterator) Key ¶
func (ri *RedisIterator) Key() (key []byte)
func (*RedisIterator) Next ¶
func (ri *RedisIterator) Next()
func (*RedisIterator) Valid ¶
func (ri *RedisIterator) Valid() bool
func (*RedisIterator) Value ¶
func (ri *RedisIterator) Value() (value []byte)
Click to show internal directories.
Click to hide internal directories.