Versions in this module Expand all Collapse all v0 v0.0.3 Jul 5, 2022 v0.0.2 Jun 29, 2022 Changes in this version + func NoopHash(query string, args []driver.NamedValue) (string, error) + type Config struct + Cache cache.Cacher + HashFunc func(query string, args []driver.NamedValue) (string, error) + OnError func(error) + type Interceptor struct + func NewInterceptor(config *Config) (*Interceptor, error) + func (i *Interceptor) ConnQueryContext(ctx context.Context, conn driver.QueryerContext, query string, ...) (context.Context, driver.Rows, error) + func (i *Interceptor) Disable() + func (i *Interceptor) Driver(d driver.Driver) driver.Driver + func (i *Interceptor) Enable() + func (i *Interceptor) Stats() *Stats + func (i *Interceptor) StmtQueryContext(ctx context.Context, conn driver.StmtQueryContext, query string, ...) (context.Context, driver.Rows, error) + type KeyRWLock struct + func (k *KeyRWLock) Lock(key interface{}) *sync.RWMutex + func (k *KeyRWLock) RLock(key interface{}) *sync.RWMutex + func (k *KeyRWLock) RUnlock(key interface{}) + func (k *KeyRWLock) Unlock(key interface{}) + type Redis struct + func NewRedis(c redis.UniversalClient, keyPrefix string) *Redis + func (r *Redis) Get(key string) (*cache.Item, bool, error) + func (r *Redis) Set(key string, item *cache.Item, ttl time.Duration) error + type Ristretto struct + func NewRistretto(c *ristretto.Cache) *Ristretto + func (r *Ristretto) Get(key string) (*cache.Item, bool, error) + func (r *Ristretto) Set(key string, item *cache.Item, ttl time.Duration) error + type Stats struct + Errors uint64 + Hits uint64 + Misses uint64