package retrystore
import "github.com/ipfs/go-datastore/retrystore"
Package retrystore provides a datastore wrapper which allows to retry operations.
Index ¶
- type Datastore
- func (d *Datastore) DiskUsage(ctx context.Context) (uint64, error)
- func (d *Datastore) Get(ctx context.Context, k ds.Key) ([]byte, error)
- func (d *Datastore) GetSize(ctx context.Context, k ds.Key) (int, error)
- func (d *Datastore) Has(ctx context.Context, k ds.Key) (bool, error)
- func (d *Datastore) Put(ctx context.Context, k ds.Key, val []byte) error
- func (d *Datastore) Sync(ctx context.Context, prefix ds.Key) error
Types ¶
type Datastore ¶
Datastore wraps a Batching datastore with a user-provided TempErrorFunc -which determines if an error is a temporal error and thus, worth retrying-, an amount of Retries -which specify how many times to retry an operation after a temporal error- and a base Delay, which is multiplied by the current retry and performs a pause before attempting the operation again.
func (*Datastore) DiskUsage ¶
DiskUsage implements the PersistentDatastore interface.
func (*Datastore) Get ¶
Get retrieves a value given a key.
func (*Datastore) GetSize ¶
GetSize returns the size of the value in the datastore, if present.
func (*Datastore) Has ¶
Has checks if a key is stored.
func (*Datastore) Put ¶
Put stores a key/value.
func (*Datastore) Sync ¶
Sync implements Datastore.Sync
Source Files ¶
- Version
- v0.8.2 (latest)
- Published
- Mar 4, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 1 month ago –
Tools for package owners.