gndlbs

package module
v0.0.0-...-f23d06c Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: BSL-1.0 Imports: 10 Imported by: 0

README

gndlbs

gndlbs is a Lotus blockstore implementation using Gonudb, an append-only key/value datastore written in Go.

Go Report Card go.dev reference

Author

Written by:

License

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

Documentation

Index

Constants

View Source
const (
	BlockSize  = 4096 // should align with ssd block size
	LoadFactor = 0.5  // target occupancy of buckets
)

Variables

View Source
var BlocksBucket = []byte("blocks")

Functions

This section is empty.

Types

type Blockstore

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

func Open

func Open(directory string, name string, opts *gonudb.StoreOptions) (*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

type Options

type Options = gonudb.StoreOptions

Jump to

Keyboard shortcuts

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