blockstore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteInto

func WriteInto(view ipld.View, bs BlockWriter) error

Types

type BlockReader

type BlockReader interface {
	Get(link ipld.Link) (ipld.Block, bool, error)
	Iterator() iter.Seq2[ipld.Block, error]
}

func NewBlockReader

func NewBlockReader(options ...Option) (BlockReader, error)

type BlockStore

type BlockStore interface {
	BlockReader
	BlockWriter
}

func NewBlockStore

func NewBlockStore(options ...Option) (BlockStore, error)

type BlockWriter

type BlockWriter interface {
	Put(block ipld.Block) error
}

type Option

type Option func(cfg *bsConfig) error

Option is an option configuring a block reader/writer.

func WithBlocks

func WithBlocks(blks []ipld.Block) Option

WithBlocks configures the blocks the blockstore should contain.

func WithBlocksIterator

func WithBlocksIterator(blks iter.Seq2[ipld.Block, error]) Option

WithBlocksIterator configures the blocks the blockstore should contain.

Jump to

Keyboard shortcuts

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