Versions in this module Expand all Collapse all v1 v1.0.3 Jun 19, 2025 v1.0.2 Apr 9, 2025 v1.0.1 Aug 26, 2024 v1.0.0 Aug 20, 2024 Changes in this version + var ErrConfigAddrEmpty = errors.New("config Addr must not be empty") + var ErrConfigMasterNameEmpty = errors.New("config MasterName must not be empty") + type Config struct + Addr string + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + DB int + DialTimeout time.Duration + IdleCheckFrequency time.Duration + IdleTimeout time.Duration + KeyPrefix string + Limiter redis.Limiter + Logger Logger + MaxConnAge time.Duration + MaxIdleConns int + MaxRetries int + MaxRetryBackoff time.Duration + MinIdleConns int + MinRetryBackoff time.Duration + Network string + Password string + PoolSize int + PoolTimeout time.Duration + ReadTimeout time.Duration + TLSConfig *tls.Config + Username string + WriteTimeout time.Duration + type FailoverConfig struct + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + DB int + DialTimeout time.Duration + IdleTimeout time.Duration + KeyPrefix string + Logger Logger + MasterName string + MaxConnAge time.Duration + MaxIdleConns int + MaxRetries int + MaxRetryBackoff time.Duration + MinIdleConns int + MinRetryBackoff time.Duration + Password string + PoolSize int + PoolTimeout time.Duration + ReadTimeout time.Duration + ReplicaOnly bool + RouteByLatency bool + RouteRandomly bool + SentinelAddrs []string + SentinelPassword string + SentinelUsername string + SlaveOnly bool + TLSConfig *tls.Config + Username string + WriteTimeout time.Duration + type Logger interface + Printf func(ctx context.Context, format string, v ...interface{}) + type Provider struct + func New() (*Provider, error) + func NewFailover(cfg FailoverConfig) (*Provider, error) + func NewFailoverCluster(cfg FailoverConfig) (*Provider, error) + func (p *Provider) Count() int + func (p *Provider) Destroy(id []byte) error + func (p *Provider) GC() error + func (p *Provider) Get(id []byte) ([]byte, error) + func (p *Provider) NeedGC() bool + func (p *Provider) Regenerate(id, newID []byte, expiration time.Duration) error + func (p *Provider) Save(id, data []byte, expiration time.Duration) error