redis

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterRedis

type ClusterRedis struct {
	// contains filtered or unexported fields
}

ClusterRedis 表示 Redis 集群缓存客户端。

func NewClusterRedis

func NewClusterRedis(cfg *configv1.Data_Redis) (*ClusterRedis, func(), error)

NewClusterRedis 创建 Redis 集群缓存实例。

func (*ClusterRedis) Connect

func (s *ClusterRedis) Connect() error

func (*ClusterRedis) Del

func (s *ClusterRedis) Del(key string) error

func (*ClusterRedis) DisConnect

func (s *ClusterRedis) DisConnect() error

func (*ClusterRedis) Exists

func (s *ClusterRedis) Exists(key string) bool

func (*ClusterRedis) Expire

func (s *ClusterRedis) Expire(key string, dur time.Duration) error

func (*ClusterRedis) Get

func (s *ClusterRedis) Get(key string) (string, error)

func (*ClusterRedis) HDel

func (s *ClusterRedis) HDel(key, field string) error

func (*ClusterRedis) HExists

func (s *ClusterRedis) HExists(key, field string) error

func (*ClusterRedis) HGet

func (s *ClusterRedis) HGet(key, field string) (string, error)

func (*ClusterRedis) HGetAll

func (s *ClusterRedis) HGetAll(key string) (map[string]string, error)

func (*ClusterRedis) HSet

func (s *ClusterRedis) HSet(key, field, value string) error

func (*ClusterRedis) Set

func (s *ClusterRedis) Set(key, value string, expire time.Duration) error

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(cfg *configv1.Data_Redis) (*Redis, func(), error)

NewRedis 创建单机 Redis 缓存实例。

func (*Redis) Del

func (s *Redis) Del(key string) error

func (*Redis) Exists

func (s *Redis) Exists(key string) bool

func (*Redis) Expire

func (s *Redis) Expire(key string, dur time.Duration) error

func (*Redis) Get

func (s *Redis) Get(key string) (string, error)

func (*Redis) HDel

func (s *Redis) HDel(key, field string) error

func (*Redis) HExists

func (s *Redis) HExists(key, field string) error

func (*Redis) HGet

func (s *Redis) HGet(key, field string) (string, error)

func (*Redis) HGetAll

func (s *Redis) HGetAll(key string) (map[string]string, error)

func (*Redis) HSet

func (s *Redis) HSet(key, field, value string) error

func (*Redis) Set

func (s *Redis) Set(key, value string, expire time.Duration) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL