package
0.0.0-20190407150747-8b9b72514244
Repository: https://github.com/ipsn/go-ipfs.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.
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
This module uses Gx to manage dependencies. You can use make all
to build it with the gx
dependencies.
Contribute
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
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.
NewGCBlockstore returns a default implementation of GCBlockstore using the given Blockstore and GCLocker.
NewGCLocker returns a default implementation of GCLocker using standard [RW] mutexes.
No description provided by the author
# Variables
BlockPrefix namespaces blockstore datastores.
ErrHashMismatch is an error returned when the hash of a block is different than expected.
ErrNotFound is an error returned when a block is not found.
# 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.