Documentation
¶
Index ¶
- type Config
- type RedisCache
- func (rc *RedisCache) Clear(ctx context.Context) error
- func (rc *RedisCache) Close() error
- func (rc *RedisCache) Delete(ctx context.Context, key string) error
- func (rc *RedisCache) Exists(ctx context.Context, key string) (bool, error)
- func (rc *RedisCache) Get(ctx context.Context, key string) ([]byte, error)
- func (rc *RedisCache) Ping(ctx context.Context) error
- func (rc *RedisCache) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
- func (rc *RedisCache) Stats(ctx context.Context) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Connection
Host string
Port string
Password string
Database int
URL string
// Pool settings
MaxRetries int
PoolSize int
MinIdleConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
ConnMaxIdleTime time.Duration
// TLS
UseTLS bool
CertFile string
KeyFile string
CAFile string
// Common
KeyPrefix string
Namespace string
}
Config holds Redis specific configuration
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
RedisCache implements cache using Redis
func (*RedisCache) Clear ¶
func (rc *RedisCache) Clear(ctx context.Context) error
Clear removes all keys with the prefix
func (*RedisCache) Delete ¶
func (rc *RedisCache) Delete(ctx context.Context, key string) error
Delete removes a key
func (*RedisCache) Ping ¶
func (rc *RedisCache) Ping(ctx context.Context) error
Ping checks if Redis is reachable
Click to show internal directories.
Click to hide internal directories.