delayed

package
v0.0.0-...-8b9b725 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT, MIT Imports: 4 Imported by: 4

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() (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(key ds.Key) (err error)

Delete implements the ds.Datastore interface.

func (*Delayed) DiskUsage

func (dds *Delayed) DiskUsage() (uint64, error)

DiskUsage implements the ds.PersistentDatastore interface.

func (*Delayed) Get

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

Get implements the ds.Datastore interface.

func (*Delayed) GetSize

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

GetSize implements the ds.Datastore interface.

func (*Delayed) Has

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

Has implements the ds.Datastore interface.

func (*Delayed) Put

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

Put implements the ds.Datastore interface.

func (*Delayed) Query

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

Query implements the ds.Datastore interface.

Jump to

Keyboard shortcuts

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