brefstore

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRefStore

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

BlockRefStore is a wrapper over datastore that stores block reference. It implements block store interface.

func NewBlockRefStore

func NewBlockRefStore(ctx context.Context, opts Opts) (*BlockRefStore, error)

NewBlockRefStore creates a new block reference store.

@input - context, options.

@output - block reference store, error.

func (*BlockRefStore) AllKeysChan

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

AllKeysChan implements blockstore.Blockstore interface.

func (*BlockRefStore) DeleteBlock

func (s *BlockRefStore) DeleteBlock(ctx context.Context, id cid.Cid) error

DeleteBlock implements a blockstore.Blockstore interface.

func (*BlockRefStore) Get

func (s *BlockRefStore) Get(ctx context.Context, id cid.Cid) (blocks.Block, error)

Get implements blockstore.Blockstore interface.

func (*BlockRefStore) GetSize

func (s *BlockRefStore) GetSize(ctx context.Context, id cid.Cid) (int, error)

GetSize implements blockstore.Blockstore interface.

func (*BlockRefStore) Has

func (s *BlockRefStore) Has(ctx context.Context, id cid.Cid) (bool, error)

Has implements blockstore.Blockstore interface.

func (*BlockRefStore) HashOnRead

func (s *BlockRefStore) HashOnRead(enabled bool)

HashOnRead implements blockstore.Blockstore interface.

func (*BlockRefStore) Put

func (s *BlockRefStore) Put(ctx context.Context, blk blocks.Block) error

Put implements blockstore.Blockstore interface.

func (*BlockRefStore) PutMany

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

PutMany implements blockstore.Blockstore interface.

func (*BlockRefStore) PutRef

func (s *BlockRefStore) PutRef(ctx context.Context, blk blocks.Block, path string, offset uint64, trailerLen uint32) error

PutRef puts a block reference into the datastore.

func (*BlockRefStore) Shutdown

func (s *BlockRefStore) Shutdown(ctx context.Context) error

Shutdown safely shuts down the store.

@input - context.

@output - error.

type Opts

type Opts struct {
	// The datastore path of the store.
	Path string
}

Opts is the options for block reference store.

Jump to

Keyboard shortcuts

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