lmdbbs

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0, MIT Imports: 8 Imported by: 0

README

go-bs-lmdb

An LMDB-backed IPFS Blockstore.

License

Dual-licensed: MIT, Apache Software License v2, by way of the Permissive License Stack.

Documentation

Index

Constants

View Source
const (
	MaxDBs        = 1       // needs to be configurable.
	MapSize       = 1 << 38 // 256GiB, this will need to be configurable.
	MaxReaders    = 128
	FreelistReuse = uint(1000) // pages, in case we decide to use https://github.com/ledgerwatch/lmdb-go (non-viral license).
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockstore

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

func Open

func Open(path string) (*Blockstore, error)

func (*Blockstore) AllKeysChan

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

func (*Blockstore) Close

func (b *Blockstore) Close() error

func (*Blockstore) DeleteBlock

func (b *Blockstore) DeleteBlock(cid cid.Cid) error

func (*Blockstore) Get

func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error)

func (*Blockstore) GetSize

func (b *Blockstore) GetSize(cid cid.Cid) (int, error)

func (*Blockstore) Has

func (b *Blockstore) Has(cid cid.Cid) (bool, error)

func (*Blockstore) HashOnRead

func (b *Blockstore) HashOnRead(_ bool)

func (*Blockstore) Put

func (b *Blockstore) Put(block blocks.Block) error

func (*Blockstore) PutMany

func (b *Blockstore) PutMany(blocks []blocks.Block) error

func (*Blockstore) View

func (b *Blockstore) View(cid cid.Cid, callback func([]byte) error) error

Jump to

Keyboard shortcuts

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