delayed

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 5 Imported by: 26

Documentation

Overview

Package delayed wraps a datastore allowing to artificially delay all operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delayed

type Delayed struct {
	// contains filtered or unexported fields
}

Delayed is an adapter that delays operations on the inner datastore.

func New

func New(ds ds.Datastore, delay delay.D) *Delayed

New returns a new delayed datastore.

func (*Delayed) Batch

func (dds *Delayed) Batch(ctx context.Context) (ds.Batch, error)

Batch implements the ds.Batching interface.

func (*Delayed) Close

func (dds *Delayed) Close() error

Close closes the inner datastore (if it implements the io.Closer interface).

func (*Delayed) Delete

func (dds *Delayed) Delete(ctx context.Context, key ds.Key) (err error)

Delete implements the ds.Datastore interface.

func (*Delayed) DiskUsage

func (dds *Delayed) DiskUsage(ctx context.Context) (uint64, error)

DiskUsage implements the ds.PersistentDatastore interface.

func (*Delayed) Get

func (dds *Delayed) Get(ctx context.Context, key ds.Key) (value []byte, err error)

Get implements the ds.Datastore interface.

func (*Delayed) GetSize

func (dds *Delayed) GetSize(ctx context.Context, key ds.Key) (size int, err error)

GetSize implements the ds.Datastore interface.

func (*Delayed) Has

func (dds *Delayed) Has(ctx context.Context, key ds.Key) (exists bool, err error)

Has implements the ds.Datastore interface.

func (*Delayed) Put

func (dds *Delayed) Put(ctx context.Context, key ds.Key, value []byte) (err error)

Put implements the ds.Datastore interface.

func (*Delayed) Query

func (dds *Delayed) Query(ctx context.Context, q dsq.Query) (dsq.Results, error)

Query implements the ds.Datastore interface.

func (*Delayed) Sync added in v0.3.0

func (dds *Delayed) Sync(ctx context.Context, prefix ds.Key) error

Sync implements Datastore.Sync

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL