Documentation ¶
Index ¶
- type Config
- type Store
- func (s *Store) Check(ctx context.Context, key string) (bool, error)
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) EXP(ctx context.Context, key string, expiration time.Duration) (bool, error)
- func (s *Store) Expire(ctx context.Context, key string, expiration time.Duration) error
- func (s *Store) Get(ctx context.Context, key string) (string, bool, error)
- func (s *Store) Set(ctx context.Context, key, value string, expiration time.Duration) error
- func (s *Store) Set1(ctx context.Context, key string, expiration time.Duration) error
- func (s *Store) TTL(ctx context.Context, key string) (time.Duration, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string // 地址(IP:Port) DB int // 数据库 Password string // 密码 KeyPrefix string // 存储key的前缀 }
Config redis配置参数
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store redis存储
func NewStoreWithClient ¶
NewStoreWithClient 使用redis客户端创建存储实例
func NewStoreWithClusterClient ¶
func NewStoreWithClusterClient(cli *redis.ClusterClient, keyPrefix string) *Store
NewStoreWithClusterClient 使用redis集群客户端创建存储实例
Click to show internal directories.
Click to hide internal directories.