Documentation
¶
Overview ¶
Package badgerstore implements the blob.Store interface using BadgerDB.
Index ¶
- func Opener(_ context.Context, addr string) (blob.StoreCloser, error)
- type KV
- func (s KV) Close(_ context.Context) error
- func (s KV) Delete(_ context.Context, key string) error
- func (s KV) Get(_ context.Context, key string) (data []byte, err error)
- func (s KV) Has(_ 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(_ context.Context, opts blob.PutOptions) error
- type Options
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Opener ¶
Opener constructs a filestore from an address comprising a URL, for use with the store package. The host and path of the URL give the path of the database directory.
Optional query parameters include:
base_size=n : base table size in MiB (default 2) compact_on_close : do a L0 compaction on close (default true) index_cache=m : index cache size in MiB (default 50) read_only : open the database in read-only mode (default false) auto_sync : automatically sync writes when GCing (default false)
Types ¶
type KV ¶ added in v0.6.0
type KV struct {
// contains filtered or unexported fields
}
KV implements the blob.KV interface using a Badger key-value store.
func (KV) Close ¶ added in v0.6.0
Close implements part of the blob.KV interface. It closes the underlying database instance and reports its result.
type Options ¶ added in v0.4.0
type Options struct { // Badger are the options to use for creating or opening a BadgerDB. // At least the Dir field must be set. Badger badger.Options // AutoSync, if true, enables automatic periodic sync to disk. AutoSync bool // KeyPrefix, if non-empty, is automatically prepended to all keys, and // scopes the resulting access to only keys having that prefix. KeyPrefix string }
type Store ¶
Store implements the blob.Store interface using a BadgerDB instance.
Click to show internal directories.
Click to hide internal directories.