Documentation
¶
Index ¶
- func ConsumeIfExists(ctx context.Context, client goredis.UniversalClient, key string) (bool, error)
- func DeleteByPattern(ctx context.Context, client goredis.UniversalClient, pattern string, ...) (int, error)
- func JitterTTL(ttl time.Duration, ratio float64) time.Duration
- func ScanKeys(ctx context.Context, client goredis.UniversalClient, pattern string, ...) ([]string, error)
- type DeleteBatch
- type DeleteByPatternOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumeIfExists ¶
ConsumeIfExists atomically checks and deletes a single key.
func DeleteByPattern ¶
func DeleteByPattern(ctx context.Context, client goredis.UniversalClient, pattern string, opts DeleteByPatternOptions) (int, error)
DeleteByPattern scans and deletes keys in batches. When DryRun is enabled, it only counts matches and does not delete them.
Types ¶
type DeleteBatch ¶
DeleteBatch contains a single scan/delete batch result.
type DeleteByPatternOptions ¶
type DeleteByPatternOptions struct {
ScanCount int64
BatchSize int
UseUnlink bool
DeleteTimeout time.Duration
DryRun bool
OnBatch func(DeleteBatch)
}
DeleteByPatternOptions controls batched key deletion.
func DefaultDeleteByPatternOptions ¶
func DefaultDeleteByPatternOptions() DeleteByPatternOptions
DefaultDeleteByPatternOptions returns the canonical pattern-deletion defaults.
Click to show internal directories.
Click to hide internal directories.