sync

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: 4 Imported by: 432

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MutexDatastore

type MutexDatastore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MutexDatastore contains a child datastore and a mutex. used for coarse sync

func MutexWrap

func MutexWrap(d ds.Datastore) *MutexDatastore

MutexWrap constructs a datastore with a coarse lock around the entire datastore, for every single operation.

func (*MutexDatastore) Batch

func (d *MutexDatastore) Batch(ctx context.Context) (ds.Batch, error)

func (*MutexDatastore) Check

func (d *MutexDatastore) Check(ctx context.Context) error

func (*MutexDatastore) Children

func (d *MutexDatastore) Children() []ds.Datastore

Children implements Shim

func (*MutexDatastore) Close

func (d *MutexDatastore) Close() error

func (*MutexDatastore) CollectGarbage

func (d *MutexDatastore) CollectGarbage(ctx context.Context) error

func (*MutexDatastore) Delete

func (d *MutexDatastore) Delete(ctx context.Context, key ds.Key) (err error)

Delete implements Datastore.Delete

func (*MutexDatastore) DiskUsage

func (d *MutexDatastore) DiskUsage(ctx context.Context) (uint64, error)

DiskUsage implements the PersistentDatastore interface.

func (*MutexDatastore) Get

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

Get implements Datastore.Get

func (*MutexDatastore) GetSize

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

GetSize implements Datastore.GetSize

func (*MutexDatastore) Has

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

Has implements Datastore.Has

func (*MutexDatastore) Put

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

Put implements Datastore.Put

func (*MutexDatastore) Query

func (d *MutexDatastore) Query(ctx context.Context, q dsq.Query) (dsq.Results, error)

Query implements Datastore.Query

func (*MutexDatastore) Scrub

func (d *MutexDatastore) Scrub(ctx context.Context) error

func (*MutexDatastore) Sync added in v0.3.0

func (d *MutexDatastore) 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