Documentation
¶
Index ¶
- type Interface
- type Options
- func (r *Options) Client() *redis.ClusterClient
- func (r *Options) Del(ctx context.Context, keys ...string) error
- func (r *Options) Existed(ctx context.Context, keys ...string) bool
- func (r *Options) Expire(ctx context.Context, key string, duration time.Duration) error
- func (r *Options) Get(ctx context.Context, key string) (string, error)
- func (r *Options) Keys(ctx context.Context, pattern string) ([]string, error)
- func (r *Options) Set(ctx context.Context, key, value string, expiration time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { Client() *redis.ClusterClient Set(ctx context.Context, key, value string, expiration time.Duration) error Get(ctx context.Context, key string) (string, error) Existed(ctx context.Context, keys ...string) bool Keys(ctx context.Context, pattern string) ([]string, error) Del(ctx context.Context, keys ...string) error Expire(ctx context.Context, key string, duration time.Duration) error }
Interface Redis 集群操作接口
type Options ¶
type Options struct { Address []string `json:"address,omitempty" yaml:"address,omitempty" xml:"address,omitempty"` Username string `json:"username,omitempty" yaml:"username,omitempty" xml:"username,omitempty"` Password string `json:"password,omitempty" yaml:"password,omitempty" xml:"password,omitempty"` DB int32 `json:"db,omitempty" yaml:"db,omitempty" xml:"db,omitempty"` }
func (*Options) Client ¶
func (r *Options) Client() *redis.ClusterClient
Client 创建并返回一个新的Redis集群客户端。
Click to show internal directories.
Click to hide internal directories.