remoteblockstore

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0, MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRemoteBlockstore

func NewRemoteBlockstore(api RemoteBlockstoreAPI, blockMetrics BlockMetrics) blockstore.Blockstore

Types

type BlockMetrics

type BlockMetrics struct {
	GetRequestCount             *stats.Int64Measure
	GetFailResponseCount        *stats.Int64Measure
	GetSuccessResponseCount     *stats.Int64Measure
	BytesSentCount              *stats.Int64Measure
	HasRequestCount             *stats.Int64Measure
	HasFailResponseCount        *stats.Int64Measure
	HasSuccessResponseCount     *stats.Int64Measure
	GetSizeRequestCount         *stats.Int64Measure
	GetSizeFailResponseCount    *stats.Int64Measure
	GetSizeSuccessResponseCount *stats.Int64Measure
}

type RemoteBlockstore

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

RemoteBlockstore is a read-only blockstore over all cids across all pieces on a provider.

func (*RemoteBlockstore) AllKeysChan

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

func (*RemoteBlockstore) DeleteBlock

func (ro *RemoteBlockstore) DeleteBlock(context.Context, cid.Cid) error

--- UNSUPPORTED BLOCKSTORE METHODS -------

func (*RemoteBlockstore) Get

func (ro *RemoteBlockstore) Get(ctx context.Context, c cid.Cid) (b blocks.Block, err error)

func (*RemoteBlockstore) GetSize

func (ro *RemoteBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error)

func (*RemoteBlockstore) Has

func (ro *RemoteBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error)

func (*RemoteBlockstore) HashOnRead

func (ro *RemoteBlockstore) HashOnRead(_ bool)

func (*RemoteBlockstore) Put

func (*RemoteBlockstore) PutMany

type RemoteBlockstoreAPI

type RemoteBlockstoreAPI interface {
	BlockstoreGet(ctx context.Context, c cid.Cid) ([]byte, error)
	BlockstoreHas(ctx context.Context, c cid.Cid) (bool, error)
	BlockstoreGetSize(ctx context.Context, c cid.Cid) (int, error)
}

Jump to

Keyboard shortcuts

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