Documentation ¶
Overview ¶
Package failstore implements a datastore which can produce custom failures on operations by calling a user-provided error function.
Index ¶
- type FailBatch
- type Failstore
- func (d *Failstore) Batch(ctx context.Context) (ds.Batch, error)
- func (d *Failstore) Close() error
- func (d *Failstore) Delete(ctx context.Context, k ds.Key) error
- func (d *Failstore) DiskUsage(ctx context.Context) (uint64, error)
- func (d *Failstore) Get(ctx context.Context, k ds.Key) ([]byte, error)
- func (d *Failstore) GetSize(ctx context.Context, k ds.Key) (int, error)
- func (d *Failstore) Has(ctx context.Context, k ds.Key) (bool, error)
- func (d *Failstore) Put(ctx context.Context, k ds.Key, val []byte) error
- func (d *Failstore) Query(ctx context.Context, q dsq.Query) (dsq.Results, error)
- func (d *Failstore) Sync(ctx context.Context, prefix ds.Key) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailBatch ¶
type FailBatch struct {
// contains filtered or unexported fields
}
FailBatch implements batching operations on the Failstore.
type Failstore ¶
type Failstore struct {
// contains filtered or unexported fields
}
Failstore is a datastore which fails according to a user-provided function.
func NewFailstore ¶
NewFailstore creates a new datastore with the given error function. The efunc will be called with different strings depending on the datastore function: put, get, has, delete, query, batch, batch-put, batch-delete and batch-commit are the possible values.
Click to show internal directories.
Click to hide internal directories.