Documentation ¶
Index ¶
- type Cache
- func (c *Cache) AddPrefix(key string) string
- func (c *Cache) Client() interface{}
- func (c *Cache) DecrFloat(ctx context.Context, key string, value float64) (float64, error)
- func (c *Cache) DecrInt(ctx context.Context, key string, value int64) (int64, error)
- func (c *Cache) Delete(ctx context.Context, keys ...string) (bool, error)
- func (c *Cache) Get(ctx context.Context, key string, def ...interface{}) cache.Result
- func (c *Cache) GetSet(ctx context.Context, key string, fn cache.SetValueFunc) cache.Result
- func (c *Cache) Has(ctx context.Context, key string) (bool, error)
- func (c *Cache) IncrFloat(ctx context.Context, key string, value float64) (float64, error)
- func (c *Cache) IncrInt(ctx context.Context, key string, value int64) (int64, error)
- func (c *Cache) Set(ctx context.Context, key string, value interface{}, ...) error
- type Option
- func WithAddrs(addrs ...string) Option
- func WithClient(client redis.UniversalClient) Option
- func WithDB(db int) Option
- func WithMaxExpiration(maxExpiration time.Duration) Option
- func WithMaxRetries(maxRetries int) Option
- func WithMinExpiration(minExpiration time.Duration) Option
- func WithNilExpiration(nilExpiration time.Duration) Option
- func WithNilValue(nilValue string) Option
- func WithPassword(password string) Option
- func WithPrefix(prefix string) Option
- func WithUsername(username string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(o *options)
func WithMaxExpiration ¶
WithMaxExpiration 设置最大过期时间
func WithMinExpiration ¶
WithMinExpiration 设置最小过期时间
func WithNilExpiration ¶
WithNilExpiration 设置空值过期时间
Click to show internal directories.
Click to hide internal directories.