Documentation ¶
Index ¶
- func NewRedisCache() factory.Cache
- func NewRedisClusterCache() factory.Cache
- func WithRedisClusterOptions(cfg ClusterOptions) factory.CacheOption
- func WithRedisOptions(cfg Options) factory.CacheOption
- type Cache
- func (c *Cache) ClearAll() error
- func (c *Cache) Close() error
- func (c *Cache) Decr(key string) error
- func (c *Cache) Delete(key string) error
- func (c *Cache) Get(key string) ([]byte, error)
- func (c *Cache) Incr(key string) error
- func (c *Cache) IsExist(key string) bool
- func (c *Cache) Put(key string, val interface{}, timeout time.Duration) error
- func (c *Cache) StartAndConfigure(ops ...factory.CacheOption) error
- type ClusterCache
- func (c *ClusterCache) ClearAll() error
- func (c *ClusterCache) Close() error
- func (c *ClusterCache) Decr(key string) error
- func (c *ClusterCache) Delete(key string) error
- func (c *ClusterCache) Get(key string) ([]byte, error)
- func (c *ClusterCache) Incr(key string) error
- func (c *ClusterCache) IsExist(key string) bool
- func (c *ClusterCache) Put(key string, val interface{}, timeout time.Duration) error
- func (c *ClusterCache) StartAndConfigure(ops ...factory.CacheOption) error
- type ClusterOptions
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisCache ¶
func NewRedisClusterCache ¶
func WithRedisClusterOptions ¶
func WithRedisClusterOptions(cfg ClusterOptions) factory.CacheOption
func WithRedisOptions ¶
func WithRedisOptions(cfg Options) factory.CacheOption
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) StartAndConfigure ¶
func (c *Cache) StartAndConfigure(ops ...factory.CacheOption) error
type ClusterCache ¶
type ClusterCache struct {
// contains filtered or unexported fields
}
func (*ClusterCache) ClearAll ¶
func (c *ClusterCache) ClearAll() error
func (*ClusterCache) Close ¶
func (c *ClusterCache) Close() error
func (*ClusterCache) Decr ¶
func (c *ClusterCache) Decr(key string) error
func (*ClusterCache) Delete ¶
func (c *ClusterCache) Delete(key string) error
func (*ClusterCache) Incr ¶
func (c *ClusterCache) Incr(key string) error
func (*ClusterCache) IsExist ¶
func (c *ClusterCache) IsExist(key string) bool
func (*ClusterCache) Put ¶
func (c *ClusterCache) Put(key string, val interface{}, timeout time.Duration) error
func (*ClusterCache) StartAndConfigure ¶
func (c *ClusterCache) StartAndConfigure(ops ...factory.CacheOption) error
type ClusterOptions ¶
type ClusterOptions struct { Address []string `mapstructure:"address" json:"address"` Password string `mapstructure:"password" json:"password"` MaxRetries int `mapstructure:"maxRetries" json:"maxRetries"` PoolSize int `mapstructure:"poolSize" json:"poolSize"` Prefix string `mapstructure:"prefix" json:"prefix"` }
Click to show internal directories.
Click to hide internal directories.