redis

package
v0.0.0-...-5745f2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisCache

func NewRedisCache() factory.Cache

func NewRedisClusterCache

func NewRedisClusterCache() factory.Cache

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) ClearAll

func (c *Cache) ClearAll() error

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Decr

func (c *Cache) Decr(key string) error

func (*Cache) Delete

func (c *Cache) Delete(key string) error

func (*Cache) Get

func (c *Cache) Get(key string) ([]byte, error)

func (*Cache) Incr

func (c *Cache) Incr(key string) error

func (*Cache) IsExist

func (c *Cache) IsExist(key string) bool

func (*Cache) Put

func (c *Cache) Put(key string, val interface{}, timeout time.Duration) error

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) Get

func (c *ClusterCache) Get(key string) ([]byte, 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"`
}

type Options

type Options struct {
	Addr       string `mapstructure:"addr" json:"addr"`
	Password   string `mapstructure:"password" json:"password"`
	MaxRetries int    `mapstructure:"maxRetries" json:"maxRetries"`
	PoolSize   int    `mapstructure:"poolSize" json:"poolSize"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL