Documentation
¶
Index ¶
- Constants
- type Cache
- func (c *Cache) Del(ctx context.Context, ns string, keys ...string) error
- func (c *Cache) DelNS(ctx context.Context, ns string) error
- func (c *Cache) Get(ctx context.Context, ns, key string) ([]byte, error)
- func (c *Cache) HasKey(ctx context.Context, ns, key string) (bool, error)
- func (c *Cache) Put(ctx context.Context, ns, key string, val []byte) error
- func (c *Cache) Start(ctx context.Context) error
- func (c *Cache) Stop(ctx context.Context) error
- func (c *Cache) Type() string
- type Config
Constants ¶
View Source
const Type = "redis"
Type is redis type identifier.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is Redis cache implementation.
func (*Cache) DelNS ¶
DelNS removes all keys contained under a given namespace from the cache store.
type Config ¶
type Config struct { SRV string `fig:"srv"` Addresses []string `fig:"addresses"` Username string `fig:"username"` Password string `fig:"password"` DB int `fig:"db"` DialTimeout time.Duration `fig:"dial_timeout" default:"3s"` ReadTimeout time.Duration `fig:"read_timeout" default:"5s"` WriteTimeout time.Duration `fig:"write_timeout" default:"5s"` TTL time.Duration `fig:"ttl" default:"24h"` }
Config contains Redis cache configuration.
Click to show internal directories.
Click to hide internal directories.