Documentation
¶
Index ¶
- func CheckVersionTtl(ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, ...) (time.Duration, error)
- func CheckVersionTtlAsync(redisClient *redis.Client, tracer adapter.Tracer, logger adapter.Logger, ...)
- func GetCacheVersion(ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, ...) (int, error)
- func IncrementCacheVersion(ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, ...) (int, error)
- func InvalidateVersion(ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersionTtl ¶
func CheckVersionTtlAsync ¶
func CheckVersionTtlAsync( redisClient *redis.Client, tracer adapter.Tracer, logger adapter.Logger, semaphore adapter.Semaphore, span adapter.Span, key string, ttl time.Duration, )
CheckVersionTtlAsync asynchronously ensures the version key has a TTL. If the key doesn't have a TTL, it sets one. This is exported for testing purposes.
func GetCacheVersion ¶
func GetCacheVersion( ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, logger adapter.Logger, semaphore adapter.Semaphore, versionGenerator key.KeyGeneratorFunc, versionExpire time.Duration, namespace string, prefix string, ) (int, error)
GetCacheVersion retrieves or initializes a cache version. If the version doesn't exist, it initializes it to 1.
func IncrementCacheVersion ¶
func IncrementCacheVersion( ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, logger adapter.Logger, semaphore adapter.Semaphore, versionGenerator key.KeyGeneratorFunc, session redis.Pipeliner, prefix string, namespace string, ttl time.Duration, ) (int, error)
IncrementCacheVersion increments the version counter in a Redis pipeline. TODO: for future release, we should return the command instead of the result
func InvalidateVersion ¶
func InvalidateVersion( ctx context.Context, redisClient *redis.Client, tracer adapter.Tracer, logger adapter.Logger, semaphore adapter.Semaphore, versionGenerator key.KeyGeneratorFunc, versionExpire time.Duration, keyPrefix string, namespace string, prefix string, getSession func() redis.Pipeliner, ) error
InvalidateVersion invalidates all cache entries for a namespace by incrementing the version.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.