Documentation
¶
Index ¶
- Variables
- type Cache
- func (c *Cache) Cached(keyName string, ttl interface{}, versioning bool, prefix string) ...
- func (c *Cache) CleanCache(ctx context.Context, key string, params map[string]interface{}, ...) error
- func (c *Cache) Get(ctx context.Context, key string, resultType interface{}) error
- func (c *Cache) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Operation Get ErrGetCacheMiss = errors.New("cache miss") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
RedisClient *redis.Client
Tracer adapter.Tracer
Logger adapter.Logger
Semaphore adapter.Semaphore
KeyPrefix string
KeyGenerator key.KeyGeneratorFunc
KeyVersionGenerator key.KeyGeneratorFunc
VersionGenerator key.KeyGeneratorFunc
VersionExpire time.Duration
LockGenerator key.KeyGeneratorFunc
LockDuration time.Duration
LockInterval time.Duration
ExpireDefault time.Duration
// contains filtered or unexported fields
}
Cache is the internal cache implementation.
func (*Cache) CleanCache ¶
type Options ¶
type Options struct {
KeyPrefix string
ExpireDefault time.Duration
VersionExpire time.Duration
LockDuration time.Duration
LockInterval time.Duration
Tracer adapter.Tracer
Logger adapter.Logger
Semaphore adapter.Semaphore
KeyGenerator key.KeyGeneratorFunc
KeyVersionGenerator key.KeyGeneratorFunc
VersionGenerator key.KeyGeneratorFunc
LockGenerator key.KeyGeneratorFunc
}
Options holds all cache configuration.
Click to show internal directories.
Click to hide internal directories.