blockstore

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicBlockstore

type BasicBlockstore = blockstore.Blockstore

BasicBlockstore is an alias to the original IPFS Blockstore.

type BatchDeleter

type BatchDeleter interface {
	DeleteMany(ctx context.Context, cids []cid.Cid) error
}

type Blockstore

type Blockstore interface {
	blockstore.Blockstore
	blockstore.Viewer
	BatchDeleter
}

Blockstore is the blockstore interface used by Lotus. It is the union of the basic go-ipfs blockstore, with other capabilities required by Lotus, e.g. View or Sync.

func Adapt

Adapt adapts a standard blockstore to a Lotus blockstore by enriching it with the extra methods that Lotus requires (e.g. View, Sync).

View proxies over to Get and calls the callback with the value supplied by Get. Sync noops.

func NewAPIBlockstore

func NewAPIBlockstore(cio ChainIO) Blockstore

type BlockstoreGC

type BlockstoreGC interface {
	CollectGarbage(options ...BlockstoreGCOption) error
}

BlockstoreGC is a trait for blockstores that support online garbage collection

type BlockstoreGCOption

type BlockstoreGCOption = func(*BlockstoreGCOptions) error

BlockstoreGCOption is a functional interface for controlling blockstore GC options

func WithFullGC

func WithFullGC(fullgc bool) BlockstoreGCOption

type BlockstoreGCOptions

type BlockstoreGCOptions struct {
	FullGC bool
}

BlockstoreGCOptions is a struct with GC options

type BlockstoreIterator

type BlockstoreIterator interface {
	ForEachKey(func(cid.Cid) error) error
}

BlockstoreIterator is a trait for efficient iteration

type BlockstoreSize

type BlockstoreSize interface {
	Size() (int64, error)
}

BlockstoreSize is a trait for on-disk blockstores that can report their size

type ChainIO

type ChainIO interface {
	ChainReadObj(context.Context, cid.Cid) ([]byte, error)
	ChainHasObj(context.Context, cid.Cid) (bool, error)
	ChainPutObj(context.Context, blocks.Block) error
}

type Viewer

type Viewer = blockstore.Viewer

Jump to

Keyboard shortcuts

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