gonubs

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: BSL-1.0 Imports: 11 Imported by: 0

README

gonubs

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

Check Status Test Status 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(context.Context, cid.Cid) error

func (*Blockstore) Get

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

func (*Blockstore) GetSize

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

func (*Blockstore) Has

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

func (*Blockstore) HashOnRead

func (b *Blockstore) HashOnRead(_ bool)

func (*Blockstore) Put

func (b *Blockstore) Put(ctx context.Context, block blocks.Block) error

func (*Blockstore) PutMany

func (b *Blockstore) PutMany(ctx context.Context, 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