blockstore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

blockstore contains all the basic blockstore constructors used by lotus. Any blockstores not ultimately constructed out of the building blocks in this package may not work properly.

  • This package correctly wraps blockstores with the IdBlockstore. This blockstore:
  • Filters out all puts for blocks with CIDs using the "identity" hash function.
  • Extracts inlined blocks from CIDs using the identity hash function and returns them on get/has, ignoring the contents of the blockstore.
  • In the future, this package may enforce additional restrictions on block sizes, CID validity, etc.

To make auditing for misuse of blockstores tractable, this package re-exports parts of the go-ipfs-blockstore package such that no other package needs to import it directly.

Index

Constants

This section is empty.

Variables

View Source
var DefaultCacheOpts = blockstore.DefaultCacheOpts
View Source
var ErrNotFound = blockstore.ErrNotFound
View Source
var NewGCBlockstore = blockstore.NewGCBlockstore
View Source
var NewGCLocker = blockstore.NewGCLocker

Functions

func NewBlockstore

func NewBlockstore(dstore ds.Batching) blockstore.Blockstore

NewBlockstore creates a new blockstore wrapped by the given datastore.

func NewTemporary

func NewTemporary() blockstore.Blockstore

NewTemporary returns a temporary blockstore.

func NewTemporarySync

func NewTemporarySync() blockstore.Blockstore

NewTemporary returns a thread-safe temporary blockstore.

func WrapIDStore

func WrapIDStore(bstore blockstore.Blockstore) blockstore.Blockstore

Wraps the underlying blockstore in an "identity" blockstore.

Types

type Blockstore

type Blockstore = blockstore.Blockstore

Alias so other packages don't have to import go-ipfs-blockstore

func CachedBlockstore

func CachedBlockstore(ctx context.Context, bs Blockstore, opts CacheOpts) (Blockstore, error)

type CacheOpts

type CacheOpts = blockstore.CacheOpts

type GCBlockstore

type GCBlockstore = blockstore.GCBlockstore

type GCLocker

type GCLocker = blockstore.GCLocker

Jump to

Keyboard shortcuts

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