Documentation
¶
Index ¶
- func Enumerator(ctx context.Context, iter *redis.ScanIterator) *enumerator
- func NewRedisStore(options *RedisOptions) (kv.KV, error)
- type RedisOptions
- type Store
- func (r *Store) Batch(ctx context.Context, items []*kv.BatchItem) error
- func (r *Store) BatchChunks(ctx context.Context, items enumerators.Enumerator[*kv.BatchItem], ...) error
- func (r *Store) Clear()
- func (r *Store) Close() error
- func (r *Store) Enumerate(ctx context.Context, args kv.QueryArgs) enumerators.Enumerator[*kv.Item]
- func (r *Store) Get(ctx context.Context, pk lexkey.PrimaryKey) (*kv.Item, error)
- func (r *Store) GetBatch(ctx context.Context, keys ...lexkey.PrimaryKey) ([]*kv.Item, error)
- func (r *Store) Put(ctx context.Context, item *kv.Item) error
- func (r *Store) Query(ctx context.Context, args kv.QueryArgs, sort kv.SortDirection) ([]*kv.Item, error)
- func (r *Store) Remove(ctx context.Context, pk lexkey.PrimaryKey) error
- func (r *Store) RemoveBatch(ctx context.Context, keys ...lexkey.PrimaryKey) error
- func (r *Store) RemoveRange(ctx context.Context, rangeKey lexkey.RangeKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enumerator ¶
NewPebbleEnumerator creates a new enumerator for a given Pebble iterator.
func NewRedisStore ¶
func NewRedisStore(options *RedisOptions) (kv.KV, error)
NewRedisStore initializes a new Redis provider.
Types ¶
type RedisOptions ¶
type RedisOptions struct { Addr string // e.g., "localhost:6379" Password string // Optional DB int // Redis database number (default 0) Prefix string // Optional key prefix }
RedisOptions holds configuration options for the Redis provider.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the kv.KV interface using Redis.
func (*Store) BatchChunks ¶
func (r *Store) BatchChunks(ctx context.Context, items enumerators.Enumerator[*kv.BatchItem], chunkSize int) error
BatchChunks processes batched items in chunks.
func (*Store) Enumerate ¶
func (r *Store) Enumerate(ctx context.Context, args kv.QueryArgs) enumerators.Enumerator[*kv.Item]
Enumerate returns an Enumerator for items matching the query args.
func (*Store) Query ¶
func (r *Store) Query(ctx context.Context, args kv.QueryArgs, sort kv.SortDirection) ([]*kv.Item, error)
Query retrieves items matching the query args with specified sorting.
func (*Store) RemoveBatch ¶
RemoveBatch deletes multiple items concurrently.
Click to show internal directories.
Click to hide internal directories.