Documentation ¶
Index ¶
- type DataSet
- type Options
- type Redis
- func (r *Redis) Del(ctx context.Context, key ...string) error
- func (r *Redis) DeleteWithPattern(ctx context.Context, pattern string) error
- func (r *Redis) Exists(ctx context.Context, key ...string) bool
- func (r *Redis) GetInt(ctx context.Context, key string) (int, error)
- func (r *Redis) GetMembers(ctx context.Context, key string, obj interface{}, opts ...*options.Options) (int, error)
- func (r *Redis) GetObject(ctx context.Context, key string, value interface{}, opts ...*options.Options) error
- func (r *Redis) GetString(ctx context.Context, key string) (string, error)
- func (r *Redis) MGet(ctx context.Context, keys []string, obj interface{}, opts ...*options.Options) error
- func (r *Redis) RemainingTime(ctx context.Context, key string) int
- func (r *Redis) Set(ctx context.Context, key string, value interface{}, opts ...*options.Options) error
- func (r *Redis) SetMember(ctx context.Context, key string, data []*DataSet, opts ...*options.Options) error
- func (r *Redis) SetMultiple(ctx context.Context, data []*DataSet, opts ...*options.Options) error
- type SentinelOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct { *redis.Client // contains filtered or unexported fields }
func NewRedisSentinel ¶
func NewRedisSentinel(opt *SentinelOptions) (*Redis, error)
func (*Redis) DeleteWithPattern ¶
DeleteWithPattern clear cache with a pattern
func (*Redis) GetMembers ¶
func (*Redis) GetObject ¶
func (r *Redis) GetObject(ctx context.Context, key string, value interface{}, opts ...*options.Options) error
GetObject get cache object
func (*Redis) MGet ¶
func (r *Redis) MGet(ctx context.Context, keys []string, obj interface{}, opts ...*options.Options) error
MGet get cache with multiple keys
func (*Redis) Set ¶
func (r *Redis) Set(ctx context.Context, key string, value interface{}, opts ...*options.Options) error
Set cache will use the default expiration if the expiration is not filled
type SentinelOptions ¶
Click to show internal directories.
Click to hide internal directories.