Documentation ¶
Index ¶
- type Batch
- type Datastore
- func (d *Datastore) Batch(ctx context.Context) (ds.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) Delete(ctx context.Context, key ds.Key) error
- func (d *Datastore) DiskUsage(ctx context.Context) (uint64, error)
- func (d *Datastore) Get(ctx context.Context, key ds.Key) (value []byte, err error)
- func (d *Datastore) GetSize(ctx context.Context, key ds.Key) (size int, _ error)
- func (d *Datastore) Has(ctx context.Context, key ds.Key) (exists bool, _ error)
- func (d *Datastore) Put(ctx context.Context, key ds.Key, value []byte) error
- func (d *Datastore) Query(ctx context.Context, q query.Query) (query.Results, error)
- func (d *Datastore) Sync(ctx context.Context, _ ds.Key) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore is a pebble-backed github.com/ipfs/go-datastore.Datastore.
It supports batching. It does not support TTL or transactions, because pebble doesn't have those features.
func NewDatastore ¶
NewDatastore creates a pebble-backed datastore. Users can provide pebble options or rely on Pebble's defaults.
func (*Datastore) DiskUsage ¶ added in v0.2.0
DiskUsage implements the PersistentDatastore interface and returns current size on disk.
func (*Datastore) Has ¶
Has can be used to check whether a key is stored in the datastore. Has() calls are not cheaper than Get() though. In Pebble, lookups for existing keys will also read the values. Avoid using Has() if you later expect to read the key anyways.
Click to show internal directories.
Click to hide internal directories.