Documentation
¶
Overview ¶
Package storages defines the storage interface for Cuckoo filter backends. Implementations are provided in subpackages: memory, redis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatsProvider ¶
type StatsProvider interface {
// Stats returns current filter statistics.
Stats(ctx context.Context) (*stats.FilterStats, error)
}
StatsProvider defines the interface for storage backends that provide statistics.
type Storage ¶
type Storage interface {
// MightExist checks if a value might exist in the filter.
MightExist(ctx context.Context, value string) (bool, error)
// Add inserts a value into the filter.
// Returns error if the filter is full.
Add(ctx context.Context, value string) error
// AddBatch inserts multiple values into the filter.
// Returns error if the filter becomes full.
AddBatch(ctx context.Context, values iter.Seq[string]) error
// Delete removes a value from the filter.
// Returns true if the value was found and removed.
Delete(ctx context.Context, value string) (bool, error)
// Close releases resources associated with the storage.
Close(ctx context.Context) error
}
Storage defines the interface for Cuckoo filter storage backends. Implementations must be safe for concurrent use.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memory provides an in-memory Cuckoo filter storage implementation using the seiflotfy/cuckoofilter library.
|
Package memory provides an in-memory Cuckoo filter storage implementation using the seiflotfy/cuckoofilter library. |
|
Package redis provides a Redis-backed Cuckoo filter storage implementation using RedisBloom module CF.* commands.
|
Package redis provides a Redis-backed Cuckoo filter storage implementation using RedisBloom module CF.* commands. |
Click to show internal directories.
Click to hide internal directories.