Documentation ¶
Overview ¶
Package cachestore implements a blob.Store that wraps the keyspaces of an underlying store in memory caches.
Index ¶
- type KV
- func (s *KV) Delete(ctx context.Context, key string) error
- func (s *KV) Get(ctx context.Context, key string) ([]byte, error)
- func (s *KV) Has(ctx context.Context, keys ...string) (blob.KeySet, error)
- func (s *KV) Len(ctx context.Context) (int64, error)
- func (s *KV) List(ctx context.Context, start string) iter.Seq2[string, error]
- func (s *KV) Put(ctx context.Context, opts blob.PutOptions) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KV ¶ added in v0.7.0
type KV struct {
// contains filtered or unexported fields
}
KV implements a blob.KV that delegates to an underlying store through an in-memory cache. This is appropriate for a high-latency or quota-limited remote store (such as a GCS or S3 bucket) that will not be concurrently written by other processes; concurrent readers are fine.
Both reads and writes are cached, and the store writes through to the underlying store. Negative hits from Get and Size are also cached.
func NewKV ¶ added in v0.9.0
NewKV constructs a new cached KV with the specified capacity in bytes, delegating storage operations to s. It will panic if maxBytes < 0.
type Store ¶
Store implements the blob.StoreCloser interface.