Skip to content

Commit c3692a5

Browse files
MichaelMureStebalien
authored andcommitted
extract the pinner to go-ipfs-pinner and dagutils into go-merkledag
1 parent c19bc36 commit c3692a5

33 files changed

+73
-2827
lines changed

Rules.mk

-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ ifneq ($(filter coverage% clean distclean test/unit/gotest.junit.xml,$(MAKECMDGO
4848
include $(dir)/Rules.mk
4949
endif
5050

51-
dir := pin/internal/pb
52-
include $(dir)/Rules.mk
53-
5451
# -------------------- #
5552
# universal rules #
5653
# -------------------- #

blocks/blockstoreutil/remove.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import (
66
"fmt"
77
"io"
88

9-
"github.com/ipfs/go-ipfs/pin"
10-
119
cid "github.com/ipfs/go-cid"
1210
bs "github.com/ipfs/go-ipfs-blockstore"
11+
"github.com/ipfs/go-ipfs-pinner"
1312
)
1413

1514
// RemovedBlock is used to respresent the result of removing a block.

core/commands/object/diff.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"fmt"
55
"io"
66

7-
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
8-
"github.com/ipfs/go-ipfs/dagutils"
9-
107
cmds "github.com/ipfs/go-ipfs-cmds"
8+
"github.com/ipfs/go-merkledag/dagutils"
119
path "github.com/ipfs/interface-go-ipfs-core/path"
10+
11+
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
1212
)
1313

1414
const (
@@ -70,7 +70,7 @@ Example:
7070
out := make([]*dagutils.Change, len(changes))
7171
for i, change := range changes {
7272
out[i] = &dagutils.Change{
73-
Type: change.Type,
73+
Type: dagutils.ChangeType(change.Type),
7474
Path: change.Path,
7575
}
7676

core/commands/pin.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ import (
88
"os"
99
"time"
1010

11-
core "github.com/ipfs/go-ipfs/core"
12-
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
13-
e "github.com/ipfs/go-ipfs/core/commands/e"
14-
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
15-
pin "github.com/ipfs/go-ipfs/pin"
16-
1711
bserv "github.com/ipfs/go-blockservice"
1812
cid "github.com/ipfs/go-cid"
1913
cidenc "github.com/ipfs/go-cidutil/cidenc"
2014
cmds "github.com/ipfs/go-ipfs-cmds"
2115
offline "github.com/ipfs/go-ipfs-exchange-offline"
16+
pin "github.com/ipfs/go-ipfs-pinner"
2217
ipld "github.com/ipfs/go-ipld-format"
2318
dag "github.com/ipfs/go-merkledag"
2419
verifcid "github.com/ipfs/go-verifcid"
2520
coreiface "github.com/ipfs/interface-go-ipfs-core"
2621
options "github.com/ipfs/interface-go-ipfs-core/options"
2722
"github.com/ipfs/interface-go-ipfs-core/path"
23+
24+
core "github.com/ipfs/go-ipfs/core"
25+
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
26+
e "github.com/ipfs/go-ipfs/core/commands/e"
27+
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
2828
)
2929

3030
var PinCmd = &cmds.Command{

core/core.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ import (
1414
"io"
1515

1616
"github.com/ipfs/go-filestore"
17-
"github.com/ipfs/go-ipfs/core/bootstrap"
18-
"github.com/ipfs/go-ipfs/core/node"
19-
"github.com/ipfs/go-ipfs/core/node/libp2p"
20-
"github.com/ipfs/go-ipfs/fuse/mount"
21-
"github.com/ipfs/go-ipfs/namesys"
22-
ipnsrp "github.com/ipfs/go-ipfs/namesys/republisher"
23-
"github.com/ipfs/go-ipfs/p2p"
24-
"github.com/ipfs/go-ipfs/pin"
25-
"github.com/ipfs/go-ipfs/repo"
17+
"github.com/ipfs/go-ipfs-pinner"
2618

2719
bserv "github.com/ipfs/go-blockservice"
2820
bstore "github.com/ipfs/go-ipfs-blockstore"
@@ -47,6 +39,15 @@ import (
4739
record "github.com/libp2p/go-libp2p-record"
4840
"github.com/libp2p/go-libp2p/p2p/discovery"
4941
p2pbhost "github.com/libp2p/go-libp2p/p2p/host/basic"
42+
43+
"github.com/ipfs/go-ipfs/core/bootstrap"
44+
"github.com/ipfs/go-ipfs/core/node"
45+
"github.com/ipfs/go-ipfs/core/node/libp2p"
46+
"github.com/ipfs/go-ipfs/fuse/mount"
47+
"github.com/ipfs/go-ipfs/namesys"
48+
ipnsrp "github.com/ipfs/go-ipfs/namesys/republisher"
49+
"github.com/ipfs/go-ipfs/p2p"
50+
"github.com/ipfs/go-ipfs/repo"
5051
)
5152

5253
var log = logging.Logger("core")

core/coreapi/block.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
"io"
88
"io/ioutil"
99

10-
util "github.com/ipfs/go-ipfs/blocks/blockstoreutil"
11-
pin "github.com/ipfs/go-ipfs/pin"
12-
1310
blocks "github.com/ipfs/go-block-format"
1411
cid "github.com/ipfs/go-cid"
12+
pin "github.com/ipfs/go-ipfs-pinner"
1513
coreiface "github.com/ipfs/interface-go-ipfs-core"
1614
caopts "github.com/ipfs/interface-go-ipfs-core/options"
1715
path "github.com/ipfs/interface-go-ipfs-core/path"
16+
17+
util "github.com/ipfs/go-ipfs/blocks/blockstoreutil"
1818
)
1919

2020
type BlockAPI CoreAPI

core/coreapi/coreapi.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,11 @@ import (
1818
"errors"
1919
"fmt"
2020

21-
"github.com/ipfs/go-ipfs/core"
22-
"github.com/ipfs/go-ipfs/core/node"
23-
"github.com/ipfs/go-ipfs/namesys"
24-
"github.com/ipfs/go-ipfs/pin"
25-
"github.com/ipfs/go-ipfs/repo"
26-
2721
bserv "github.com/ipfs/go-blockservice"
2822
"github.com/ipfs/go-ipfs-blockstore"
2923
"github.com/ipfs/go-ipfs-exchange-interface"
3024
offlinexch "github.com/ipfs/go-ipfs-exchange-offline"
25+
"github.com/ipfs/go-ipfs-pinner"
3126
"github.com/ipfs/go-ipfs-provider"
3227
offlineroute "github.com/ipfs/go-ipfs-routing/offline"
3328
ipld "github.com/ipfs/go-ipld-format"
@@ -42,6 +37,11 @@ import (
4237
routing "github.com/libp2p/go-libp2p-core/routing"
4338
pubsub "github.com/libp2p/go-libp2p-pubsub"
4439
record "github.com/libp2p/go-libp2p-record"
40+
41+
"github.com/ipfs/go-ipfs/core"
42+
"github.com/ipfs/go-ipfs/core/node"
43+
"github.com/ipfs/go-ipfs/namesys"
44+
"github.com/ipfs/go-ipfs/repo"
4545
)
4646

4747
var log = logging.Logger("core/coreapi")

core/coreapi/dag.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ package coreapi
33
import (
44
"context"
55

6-
"github.com/ipfs/go-ipfs/pin"
7-
86
cid "github.com/ipfs/go-cid"
7+
"github.com/ipfs/go-ipfs-pinner"
98
ipld "github.com/ipfs/go-ipld-format"
109
)
1110

core/coreapi/object.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ import (
1111
"io"
1212
"io/ioutil"
1313

14-
"github.com/ipfs/go-ipfs/dagutils"
15-
"github.com/ipfs/go-ipfs/pin"
16-
1714
cid "github.com/ipfs/go-cid"
15+
"github.com/ipfs/go-ipfs-pinner"
1816
ipld "github.com/ipfs/go-ipld-format"
1917
dag "github.com/ipfs/go-merkledag"
18+
"github.com/ipfs/go-merkledag/dagutils"
2019
ft "github.com/ipfs/go-unixfs"
2120
coreiface "github.com/ipfs/interface-go-ipfs-core"
2221
caopts "github.com/ipfs/interface-go-ipfs-core/options"
@@ -307,7 +306,7 @@ func (api *ObjectAPI) Diff(ctx context.Context, before ipath.Path, after ipath.P
307306
out := make([]coreiface.ObjectChange, len(changes))
308307
for i, change := range changes {
309308
out[i] = coreiface.ObjectChange{
310-
Type: change.Type,
309+
Type: coreiface.ChangeType(change.Type),
311310
Path: change.Path,
312311
}
313312

core/coreapi/pin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
bserv "github.com/ipfs/go-blockservice"
77
"github.com/ipfs/go-cid"
88
offline "github.com/ipfs/go-ipfs-exchange-offline"
9-
"github.com/ipfs/go-ipfs/pin"
9+
pin "github.com/ipfs/go-ipfs-pinner"
1010
ipld "github.com/ipfs/go-ipld-format"
1111
"github.com/ipfs/go-merkledag"
1212
coreiface "github.com/ipfs/interface-go-ipfs-core"

core/corerepo/gc.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"time"
88

99
"github.com/ipfs/go-ipfs/core"
10-
gc "github.com/ipfs/go-ipfs/pin/gc"
11-
repo "github.com/ipfs/go-ipfs/repo"
10+
"github.com/ipfs/go-ipfs/gc"
11+
"github.com/ipfs/go-ipfs/repo"
1212

13-
humanize "github.com/dustin/go-humanize"
14-
cid "github.com/ipfs/go-cid"
13+
"github.com/dustin/go-humanize"
14+
"github.com/ipfs/go-cid"
1515
logging "github.com/ipfs/go-log"
16-
mfs "github.com/ipfs/go-mfs"
16+
"github.com/ipfs/go-mfs"
1717
)
1818

1919
var log = logging.Logger("corerepo")

core/coreunix/add.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ import (
88
gopath "path"
99
"strconv"
1010

11-
"github.com/ipfs/go-ipfs/pin"
12-
1311
"github.com/ipfs/go-cid"
1412
bstore "github.com/ipfs/go-ipfs-blockstore"
1513
chunker "github.com/ipfs/go-ipfs-chunker"
1614
"github.com/ipfs/go-ipfs-files"
15+
"github.com/ipfs/go-ipfs-pinner"
1716
"github.com/ipfs/go-ipfs-posinfo"
1817
ipld "github.com/ipfs/go-ipld-format"
1918
logging "github.com/ipfs/go-log"

core/coreunix/add_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
"time"
1313

1414
"github.com/ipfs/go-ipfs/core"
15-
"github.com/ipfs/go-ipfs/pin/gc"
15+
"github.com/ipfs/go-ipfs/gc"
1616
"github.com/ipfs/go-ipfs/repo"
1717

1818
blocks "github.com/ipfs/go-block-format"
1919
"github.com/ipfs/go-blockservice"
20-
cid "github.com/ipfs/go-cid"
21-
datastore "github.com/ipfs/go-datastore"
20+
"github.com/ipfs/go-cid"
21+
"github.com/ipfs/go-datastore"
2222
syncds "github.com/ipfs/go-datastore/sync"
2323
blockstore "github.com/ipfs/go-ipfs-blockstore"
2424
config "github.com/ipfs/go-ipfs-config"

core/node/core.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/ipfs/go-ipfs/core/node/helpers"
8-
"github.com/ipfs/go-ipfs/pin"
9-
"github.com/ipfs/go-ipfs/repo"
10-
117
"github.com/ipfs/go-bitswap"
128
"github.com/ipfs/go-bitswap/network"
139
"github.com/ipfs/go-blockservice"
@@ -16,13 +12,17 @@ import (
1612
"github.com/ipfs/go-ipfs-blockstore"
1713
"github.com/ipfs/go-ipfs-exchange-interface"
1814
"github.com/ipfs/go-ipfs-exchange-offline"
15+
"github.com/ipfs/go-ipfs-pinner"
1916
"github.com/ipfs/go-ipld-format"
2017
"github.com/ipfs/go-merkledag"
2118
"github.com/ipfs/go-mfs"
2219
"github.com/ipfs/go-unixfs"
2320
"github.com/libp2p/go-libp2p-core/host"
2421
"github.com/libp2p/go-libp2p-core/routing"
2522
"go.uber.org/fx"
23+
24+
"github.com/ipfs/go-ipfs/core/node/helpers"
25+
"github.com/ipfs/go-ipfs/repo"
2626
)
2727

2828
// BlockService creates new blockservice which provides an interface to fetch content-addressable blocks

core/node/provider.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import (
55
"fmt"
66
"time"
77

8-
"github.com/ipfs/go-ipfs/core/node/helpers"
9-
"github.com/ipfs/go-ipfs/pin"
10-
"github.com/ipfs/go-ipfs/repo"
11-
8+
"github.com/ipfs/go-ipfs-pinner"
129
"github.com/ipfs/go-ipfs-provider"
1310
q "github.com/ipfs/go-ipfs-provider/queue"
1411
"github.com/ipfs/go-ipfs-provider/simple"
1512
ipld "github.com/ipfs/go-ipld-format"
1613
"github.com/libp2p/go-libp2p-core/routing"
1714
"go.uber.org/fx"
15+
16+
"github.com/ipfs/go-ipfs/core/node/helpers"
17+
"github.com/ipfs/go-ipfs/repo"
1818
)
1919

2020
const kReprovideFrequency = time.Hour * 12

0 commit comments

Comments
 (0)