Categorygithub.com/ipfs/go-ipfs-blockstore
modulepackage
1.3.1
Repository: https://github.com/ipfs/go-ipfs-blockstore.git
Documentation: pkg.go.dev

# README

go-ipfs-blockstore

go-ipfs-blockstore implements a thin wrapper over a datastore, giving a clean interface for Getting and Putting block objects.

standard-readme compliant GoDoc Build Status

ā— This repo is no longer maintained.

šŸ‘‰ We highly recommend switching to the maintained version at https://github.com/ipfs/boxo/tree/main/blockstore. šŸŽļø Good news! There is tooling and documentation to expedite a switch in your repo.

āš ļø If you continue using this repo, please note that security fixes will not be provided (unless someone steps in to maintain it).

šŸ“š Learn more, including how to take the maintainership mantle or ask questions, here.

Table of Contents

Install

go-ipfs-blockstore works like a regular Go module:

> go get github.com/ipfs/go-ipfs-blockstore

Usage

import "github.com/ipfs/go-ipfs-blockstore"

Check the GoDoc documentation

License

MIT Ā© Protocol Labs, Inc.

# Functions

CachedBlockstore returns a blockstore wrapped in an ARCCache and then in a bloom filter cache, if the options indicate it.
DefaultCacheOpts returns a CacheOpts initialized with default values.
NewBlockstore returns a default Blockstore implementation using the provided datastore.Batching backend.
NewBlockstoreNoPrefix returns a default Blockstore implementation using the provided datastore.Batching backend.
NewGCBlockstore returns a default implementation of GCBlockstore using the given Blockstore and GCLocker.
NewGCLocker returns a default implementation of GCLocker using standard [RW] mutexes.
Deprecated: use github.com/ipfs/boxo/blockstore.NewIdStore.
NoPrefix avoids wrapping the blockstore into the BlockPrefix namespace ("/blocks"), so keys will not be modified in any way.
WriteThrough skips checking if the blockstore already has a block before writing it.

# Variables

BlockPrefix namespaces blockstore datastores Deprecated: use github.com/ipfs/boxo/blockstore.BlockPrefix.
ErrHashMismatch is an error returned when the hash of a block is different than expected.

# Structs

CacheOpts wraps options for CachedBlockStore().
Option is a default implementation Blockstore option Deprecated: use github.com/ipfs/boxo/blockstore.Option.

# Interfaces

Blockstore wraps a Datastore block-centered methods and provides a layer of abstraction which allows to add different caching strategies.
GCBlockstore is a blockstore that can safely run garbage-collection operations.
GCLocker abstract functionality to lock a blockstore when performing garbage-collection operations.
Unlocker represents an object which can Unlock something.
Viewer can be implemented by blockstores that offer zero-copy access to values.