migratebs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockstore

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

func NewBlockstore

func NewBlockstore(from, to blockstore.Blockstore, del bool) (*Blockstore, error)

func (*Blockstore) AllKeysChan

func (bs *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

AllKeysChan returns a channel from which the CIDs in the Blockstore can be read. It should respect the given context, closing the channel if it becomes Done.

func (*Blockstore) DeleteBlock

func (bs *Blockstore) DeleteBlock(ctx context.Context, c cid.Cid) error

func (*Blockstore) DeleteMany

func (bs *Blockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error

func (*Blockstore) Get

func (bs *Blockstore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error)

func (*Blockstore) GetSize

func (bs *Blockstore) GetSize(ctx context.Context, c cid.Cid) (int, error)

GetSize returns the CIDs mapped BlockSize

func (*Blockstore) Has

func (bs *Blockstore) Has(ctx context.Context, c cid.Cid) (bool, error)

func (*Blockstore) HashOnRead

func (bs *Blockstore) HashOnRead(enabled bool)

HashOnRead specifies if every read block should be rehashed to make sure it matches its CID.

func (*Blockstore) Put

func (bs *Blockstore) Put(ctx context.Context, blk blocks.Block) error

Put puts a given block to the underlying datastore

func (*Blockstore) PutMany

func (bs *Blockstore) PutMany(ctx context.Context, blks []blocks.Block) error

PutMany puts a slice of blocks at the same time using batching capabilities of the underlying datastore whenever possible.

func (*Blockstore) View

func (bs *Blockstore) View(ctx context.Context, c cid.Cid, f func([]byte) error) error

Jump to

Keyboard shortcuts

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