Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Commit 07dfabb

Browse files
committed
chore: deprecate types and readme
1 parent 25a6cb8 commit 07dfabb

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# go-ipfs-blockstore
22

3+
> go-ipfs-blockstore implements a thin wrapper over a datastore, giving a clean interface for Getting and Putting block objects.
4+
35
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
46
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
57
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
68
[![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs-blockstore?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs-blockstore)
79
[![Build Status](https://travis-ci.com/ipfs/go-ipfs-blockstore.svg?branch=master)](https://travis-ci.com/ipfs/go-ipfs-blockstore)
810

9-
> go-ipfs-blockstore implements a thin wrapper over a datastore, giving a clean interface for Getting and Putting block objects.
10-
11-
## Lead Maintainer
11+
## ❗ This repo is no longer maintained.
12+
👉 We highly recommend switching to the maintained version at https://github.com/ipfs/boxo/tree/main/blockstore.
13+
🏎️ Good news! There is [tooling and documentation](https://github.com/ipfs/boxo#migrating-to-boxo) to expedite a switch in your repo.
1214

13-
[Steven Allen](https://github.com/Stebalien)
15+
⚠️ If you continue using this repo, please note that security fixes will not be provided (unless someone steps in to maintain it).
1416

17+
📚 Learn more, including how to take the maintainership mantle or ask questions, [here](https://github.com/ipfs/boxo/wiki/Copied-or-Migrated-Repos-FAQ).
1518

1619
## Table of Contents
1720

blockstore.go

+28
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ import (
2222
var logger = logging.Logger("blockstore")
2323

2424
// BlockPrefix namespaces blockstore datastores
25+
//
26+
// Deprecated: use github.com/ipfs/boxo/blockstore.BlockPrefix
2527
var BlockPrefix = ds.NewKey("blocks")
2628

2729
// ErrHashMismatch is an error returned when the hash of a block
2830
// is different than expected.
31+
//
32+
// Deprecated: use github.com/ipfs/boxo/blockstore.ErrHashMismatch
2933
var ErrHashMismatch = errors.New("block in storage has different hash than requested")
3034

3135
// Blockstore wraps a Datastore block-centered methods and provides a layer
3236
// of abstraction which allows to add different caching strategies.
37+
//
38+
// Deprecated: use github.com/ipfs/boxo/blockstore.Blockstore
3339
type Blockstore interface {
3440
DeleteBlock(context.Context, cid.Cid) error
3541
Has(context.Context, cid.Cid) (bool, error)
@@ -66,12 +72,16 @@ type Blockstore interface {
6672
// The callback will only be called iff the query operation is successful (and
6773
// the block is found); otherwise, the error will be propagated. Errors returned
6874
// by the callback will be propagated as well.
75+
//
76+
// Deprecated: use github.com/ipfs/boxo/blockstore.Viewer
6977
type Viewer interface {
7078
View(ctx context.Context, cid cid.Cid, callback func([]byte) error) error
7179
}
7280

7381
// GCLocker abstract functionality to lock a blockstore when performing
7482
// garbage-collection operations.
83+
//
84+
// Deprecated: use github.com/ipfs/boxo/blockstore.GCLocker
7585
type GCLocker interface {
7686
// GCLock locks the blockstore for garbage collection. No operations
7787
// that expect to finish with a pin should ocurr simultaneously.
@@ -91,13 +101,17 @@ type GCLocker interface {
91101

92102
// GCBlockstore is a blockstore that can safely run garbage-collection
93103
// operations.
104+
//
105+
// Deprecated: use github.com/ipfs/boxo/blockstore.GCBlockstore
94106
type GCBlockstore interface {
95107
Blockstore
96108
GCLocker
97109
}
98110

99111
// NewGCBlockstore returns a default implementation of GCBlockstore
100112
// using the given Blockstore and GCLocker.
113+
//
114+
// Deprecated: use github.com/ipfs/boxo/blockstore.NewGCBlockstore
101115
func NewGCBlockstore(bs Blockstore, gcl GCLocker) GCBlockstore {
102116
return gcBlockstore{bs, gcl}
103117
}
@@ -108,12 +122,16 @@ type gcBlockstore struct {
108122
}
109123

110124
// Option is a default implementation Blockstore option
125+
//
126+
// Deprecated: use github.com/ipfs/boxo/blockstore.Option
111127
type Option struct {
112128
f func(bs *blockstore)
113129
}
114130

115131
// WriteThrough skips checking if the blockstore already has a block before
116132
// writing it.
133+
//
134+
// Deprecated: use github.com/ipfs/boxo/blockstore.WriteThrough
117135
func WriteThrough() Option {
118136
return Option{
119137
func(bs *blockstore) {
@@ -124,6 +142,8 @@ func WriteThrough() Option {
124142

125143
// NoPrefix avoids wrapping the blockstore into the BlockPrefix namespace
126144
// ("/blocks"), so keys will not be modified in any way.
145+
//
146+
// Deprecated: use github.com/ipfs/boxo/blockstore.NoPrefix
127147
func NoPrefix() Option {
128148
return Option{
129149
func(bs *blockstore) {
@@ -134,6 +154,8 @@ func NoPrefix() Option {
134154

135155
// NewBlockstore returns a default Blockstore implementation
136156
// using the provided datastore.Batching backend.
157+
//
158+
// Deprecated: use github.com/ipfs/boxo/blockstore.NewBlockstore
137159
func NewBlockstore(d ds.Batching, opts ...Option) Blockstore {
138160
bs := &blockstore{
139161
datastore: d,
@@ -155,6 +177,8 @@ func NewBlockstore(d ds.Batching, opts ...Option) Blockstore {
155177
// This constructor does not modify input keys in any way
156178
//
157179
// Deprecated: Use NewBlockstore with the NoPrefix option instead.
180+
//
181+
// Deprecated: use github.com/ipfs/boxo/blockstore.NewBlockstoreNoPrefix
158182
func NewBlockstoreNoPrefix(d ds.Batching) Blockstore {
159183
return NewBlockstore(d, NoPrefix())
160184
}
@@ -305,6 +329,8 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
305329

306330
// NewGCLocker returns a default implementation of
307331
// GCLocker using standard [RW] mutexes.
332+
//
333+
// Deprecated: use github.com/ipfs/boxo/blockstore.NewGCLocker
308334
func NewGCLocker() GCLocker {
309335
return &gclocker{}
310336
}
@@ -316,6 +342,8 @@ type gclocker struct {
316342

317343
// Unlocker represents an object which can Unlock
318344
// something.
345+
//
346+
// Deprecated: use github.com/ipfs/boxo/blockstore.Unlocker
319347
type Unlocker interface {
320348
Unlock(context.Context)
321349
}

caching.go

+6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ import (
99

1010
// CacheOpts wraps options for CachedBlockStore().
1111
// Next to each option is it aproximate memory usage per unit
12+
//
13+
// Deprecated: use github.com/ipfs/boxo/blockstore.CacheOpts
1214
type CacheOpts struct {
1315
HasBloomFilterSize int // 1 byte
1416
HasBloomFilterHashes int // No size, 7 is usually best, consult bloom papers
1517
HasARCCacheSize int // 32 bytes
1618
}
1719

1820
// DefaultCacheOpts returns a CacheOpts initialized with default values.
21+
//
22+
// Deprecated: use github.com/ipfs/boxo/blockstore.DefaultCacheOpts
1923
func DefaultCacheOpts() CacheOpts {
2024
return CacheOpts{
2125
HasBloomFilterSize: 512 << 10,
@@ -26,6 +30,8 @@ func DefaultCacheOpts() CacheOpts {
2630

2731
// CachedBlockstore returns a blockstore wrapped in an ARCCache and
2832
// then in a bloom filter cache, if the options indicate it.
33+
//
34+
// Deprecated: use github.com/ipfs/boxo/blockstore.CachedBlockstore
2935
func CachedBlockstore(
3036
ctx context.Context,
3137
bs Blockstore,

idstore.go

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var _ Blockstore = (*idstore)(nil)
1919
var _ Viewer = (*idstore)(nil)
2020
var _ io.Closer = (*idstore)(nil)
2121

22+
// Deprecated: use github.com/ipfs/boxo/blockstore.NewIdStore
2223
func NewIdStore(bs Blockstore) Blockstore {
2324
ids := &idstore{bs: bs}
2425
if v, ok := bs.(Viewer); ok {

0 commit comments

Comments
 (0)