@cryptotaxi247 / kubo / commits / c613fbec3

WIP: Extract: importers/chunk module as go-ipfs-chunker

License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>

Hector Sanjuan committed Feb 5, 2018 at 20:28 UTC c613fbec3870f7cf97fc271dcbf69ccf34c1c0b5
21 files changed +20 -454
core/corehttp/gateway_handler.go
+1 -1
@@ -16,12 +16,12 @@ import (
16 coreapi "github.com/ipfs/go-ipfs/core/coreapi"
17 coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface"
18 "github.com/ipfs/go-ipfs/importer"
19 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
19 dag "github.com/ipfs/go-ipfs/merkledag"
20 dagutils "github.com/ipfs/go-ipfs/merkledag/utils"
21 path "github.com/ipfs/go-ipfs/path"
22 ft "github.com/ipfs/go-ipfs/unixfs"
23 uio "github.com/ipfs/go-ipfs/unixfs/io"
24 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
25
26 humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize"
27 routing "gx/ipfs/QmTiWLZ6Fo5j4KcTVutZJ5KWRRJrbxzmxA4td8NfEdrPh7/go-libp2p-routing"
core/coreunix/add.go
+1 -1
@@ -15,7 +15,6 @@ import (
15 core "github.com/ipfs/go-ipfs/core"
16 "github.com/ipfs/go-ipfs/exchange/offline"
17 balanced "github.com/ipfs/go-ipfs/importer/balanced"
18 - "github.com/ipfs/go-ipfs/importer/chunk"
18 ihelper "github.com/ipfs/go-ipfs/importer/helpers"
19 trickle "github.com/ipfs/go-ipfs/importer/trickle"
20 dag "github.com/ipfs/go-ipfs/merkledag"
@@ -26,6 +25,7 @@ import (
25
26 ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore"
27 syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync"
28 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
29 logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log"
30 cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
31 files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files"
core/coreunix/metadata_test.go
+1 -1
@@ -11,10 +11,10 @@ import (
11 core "github.com/ipfs/go-ipfs/core"
12 offline "github.com/ipfs/go-ipfs/exchange/offline"
13 importer "github.com/ipfs/go-ipfs/importer"
14 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
14 merkledag "github.com/ipfs/go-ipfs/merkledag"
15 ft "github.com/ipfs/go-ipfs/unixfs"
16 uio "github.com/ipfs/go-ipfs/unixfs/io"
17 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
18
19 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
20 ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore"
fuse/readonly/ipfs_test.go
+1 -1
@@ -17,9 +17,9 @@ import (
17 coreunix "github.com/ipfs/go-ipfs/core/coreunix"
18 coremock "github.com/ipfs/go-ipfs/core/mock"
19 importer "github.com/ipfs/go-ipfs/importer"
20 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
20 dag "github.com/ipfs/go-ipfs/merkledag"
21 uio "github.com/ipfs/go-ipfs/unixfs/io"
22 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
23 ci "gx/ipfs/QmVvkK7s5imCiq3JVbL3pGfnhcCnf3LrFJPF4GE2sAoGZf/go-testutil/ci"
24
25 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
importer/balanced/balanced_test.go
+1 -1
@@ -9,11 +9,11 @@ import (
9 mrand "math/rand"
10 "testing"
11
12 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
12 h "github.com/ipfs/go-ipfs/importer/helpers"
13 dag "github.com/ipfs/go-ipfs/merkledag"
14 mdtest "github.com/ipfs/go-ipfs/merkledag/test"
15 uio "github.com/ipfs/go-ipfs/unixfs/io"
16 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
17
18 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
19 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
importer/chunk/parse.go deleted
-79
@@ -1,79 +0,0 @@
1 -package chunk
2 -
3 -import (
4 - "errors"
5 - "fmt"
6 - "io"
7 - "strconv"
8 - "strings"
9 -)
10 -
11 -// FromString returns a Splitter depending on the given string:
12 -// it supports "default" (""), "size-{size}", "rabin", "rabin-{blocksize}" and
13 -// "rabin-{min}-{avg}-{max}".
14 -func FromString(r io.Reader, chunker string) (Splitter, error) {
15 - switch {
16 - case chunker == "" || chunker == "default":
17 - return DefaultSplitter(r), nil
18 -
19 - case strings.HasPrefix(chunker, "size-"):
20 - sizeStr := strings.Split(chunker, "-")[1]
21 - size, err := strconv.Atoi(sizeStr)
22 - if err != nil {
23 - return nil, err
24 - }
25 - return NewSizeSplitter(r, int64(size)), nil
26 -
27 - case strings.HasPrefix(chunker, "rabin"):
28 - return parseRabinString(r, chunker)
29 -
30 - default:
31 - return nil, fmt.Errorf("unrecognized chunker option: %s", chunker)
32 - }
33 -}
34 -
35 -func parseRabinString(r io.Reader, chunker string) (Splitter, error) {
36 - parts := strings.Split(chunker, "-")
37 - switch len(parts) {
38 - case 1:
39 - return NewRabin(r, uint64(DefaultBlockSize)), nil
40 - case 2:
41 - size, err := strconv.Atoi(parts[1])
42 - if err != nil {
43 - return nil, err
44 - }
45 - return NewRabin(r, uint64(size)), nil
46 - case 4:
47 - sub := strings.Split(parts[1], ":")
48 - if len(sub) > 1 && sub[0] != "min" {
49 - return nil, errors.New("first label must be min")
50 - }
51 - min, err := strconv.Atoi(sub[len(sub)-1])
52 - if err != nil {
53 - return nil, err
54 - }
55 -
56 - sub = strings.Split(parts[2], ":")
57 - if len(sub) > 1 && sub[0] != "avg" {
58 - log.Error("sub == ", sub)
59 - return nil, errors.New("second label must be avg")
60 - }
61 - avg, err := strconv.Atoi(sub[len(sub)-1])
62 - if err != nil {
63 - return nil, err
64 - }
65 -
66 - sub = strings.Split(parts[3], ":")
67 - if len(sub) > 1 && sub[0] != "max" {
68 - return nil, errors.New("final label must be max")
69 - }
70 - max, err := strconv.Atoi(sub[len(sub)-1])
71 - if err != nil {
72 - return nil, err
73 - }
74 -
75 - return NewRabinMinMax(r, uint64(min), uint64(avg), uint64(max)), nil
76 - default:
77 - return nil, errors.New("incorrect format (expected 'rabin' 'rabin-[avg]' or 'rabin-[min]-[avg]-[max]'")
78 - }
79 -}
importer/chunk/rabin.go deleted
-54
@@ -1,54 +0,0 @@
1 -package chunk
2 -
3 -import (
4 - "hash/fnv"
5 - "io"
6 -
7 - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/whyrusleeping/chunker"
8 -)
9 -
10 -// IpfsRabinPoly is the irreducible polynomial of degree 53 used by for Rabin.
11 -var IpfsRabinPoly = chunker.Pol(17437180132763653)
12 -
13 -// Rabin implements the Splitter interface and splits content with Rabin
14 -// fingerprints.
15 -type Rabin struct {
16 - r *chunker.Chunker
17 - reader io.Reader
18 -}
19 -
20 -// NewRabin creates a new Rabin splitter with the given
21 -// average block size.
22 -func NewRabin(r io.Reader, avgBlkSize uint64) *Rabin {
23 - min := avgBlkSize / 3
24 - max := avgBlkSize + (avgBlkSize / 2)
25 -
26 - return NewRabinMinMax(r, min, avgBlkSize, max)
27 -}
28 -
29 -// NewRabinMinMax returns a new Rabin splitter which uses
30 -// the given min, average and max block sizes.
31 -func NewRabinMinMax(r io.Reader, min, avg, max uint64) *Rabin {
32 - h := fnv.New32a()
33 - ch := chunker.New(r, IpfsRabinPoly, h, avg, min, max)
34 -
35 - return &Rabin{
36 - r: ch,
37 - reader: r,
38 - }
39 -}
40 -
41 -// NextBytes reads the next bytes from the reader and returns a slice.
42 -func (r *Rabin) NextBytes() ([]byte, error) {
43 - ch, err := r.r.Next()
44 - if err != nil {
45 - return nil, err
46 - }
47 -
48 - return ch.Data, nil
49 -}
50 -
51 -// Reader returns the io.Reader associated to this Splitter.
52 -func (r *Rabin) Reader() io.Reader {
53 - return r.reader
54 -}
importer/chunk/rabin_test.go deleted
-81
@@ -1,81 +0,0 @@
1 -package chunk
2 -
3 -import (
4 - "bytes"
5 - "fmt"
6 - "io"
7 - "testing"
8 -
9 - util "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
10 - blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format"
11 -)
12 -
13 -func TestRabinChunking(t *testing.T) {
14 - data := make([]byte, 1024*1024*16)
15 - util.NewTimeSeededRand().Read(data)
16 -
17 - r := NewRabin(bytes.NewReader(data), 1024*256)
18 -
19 - var chunks [][]byte
20 -
21 - for {
22 - chunk, err := r.NextBytes()
23 - if err != nil {
24 - if err == io.EOF {
25 - break
26 - }
27 - t.Fatal(err)
28 - }
29 -
30 - chunks = append(chunks, chunk)
31 - }
32 -
33 - fmt.Printf("average block size: %d\n", len(data)/len(chunks))
34 -
35 - unchunked := bytes.Join(chunks, nil)
36 - if !bytes.Equal(unchunked, data) {
37 - fmt.Printf("%d %d\n", len(unchunked), len(data))
38 - t.Fatal("data was chunked incorrectly")
39 - }
40 -}
41 -
42 -func chunkData(t *testing.T, data []byte) map[string]blocks.Block {
43 - r := NewRabin(bytes.NewReader(data), 1024*256)
44 -
45 - blkmap := make(map[string]blocks.Block)
46 -
47 - for {
48 - blk, err := r.NextBytes()
49 - if err != nil {
50 - if err == io.EOF {
51 - break
52 - }
53 - t.Fatal(err)
54 - }
55 -
56 - b := blocks.NewBlock(blk)
57 - blkmap[b.Cid().KeyString()] = b
58 - }
59 -
60 - return blkmap
61 -}
62 -
63 -func TestRabinChunkReuse(t *testing.T) {
64 - data := make([]byte, 1024*1024*16)
65 - util.NewTimeSeededRand().Read(data)
66 -
67 - ch1 := chunkData(t, data[1000:])
68 - ch2 := chunkData(t, data)
69 -
70 - var extra int
71 - for k := range ch2 {
72 - _, ok := ch1[k]
73 - if !ok {
74 - extra++
75 - }
76 - }
77 -
78 - if extra > 2 {
79 - t.Log("too many spare chunks made")
80 - }
81 -}
importer/chunk/splitting.go deleted
-105
@@ -1,105 +0,0 @@
1 -// Package chunk implements streaming block splitters.
2 -// Splitters read data from a reader and provide byte slices (chunks)
3 -// The size and contents of these slices depend on the splitting method
4 -// used.
5 -package chunk
6 -
7 -import (
8 - "io"
9 -
10 - logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log"
11 - mpool "gx/ipfs/QmWBug6eBS7AxRdCDVuSY5CnSit7cS2XnPFYJWqWDumhCG/go-msgio/mpool"
12 -)
13 -
14 -var log = logging.Logger("chunk")
15 -
16 -// DefaultBlockSize is the chunk size that splitters produce (or aim to).
17 -var DefaultBlockSize int64 = 1024 * 256
18 -
19 -// A Splitter reads bytes from a Reader and creates "chunks" (byte slices)
20 -// that can be used to build DAG nodes.
21 -type Splitter interface {
22 - Reader() io.Reader
23 - NextBytes() ([]byte, error)
24 -}
25 -
26 -// SplitterGen is a splitter generator, given a reader.
27 -type SplitterGen func(r io.Reader) Splitter
28 -
29 -// DefaultSplitter returns a SizeSplitter with the DefaultBlockSize.
30 -func DefaultSplitter(r io.Reader) Splitter {
31 - return NewSizeSplitter(r, DefaultBlockSize)
32 -}
33 -
34 -// SizeSplitterGen returns a SplitterGen function which will create
35 -// a splitter with the given size when called.
36 -func SizeSplitterGen(size int64) SplitterGen {
37 - return func(r io.Reader) Splitter {
38 - return NewSizeSplitter(r, size)
39 - }
40 -}
41 -
42 -// Chan returns a channel that receives each of the chunks produced
43 -// by a splitter, along with another one for errors.
44 -func Chan(s Splitter) (<-chan []byte, <-chan error) {
45 - out := make(chan []byte)
46 - errs := make(chan error, 1)
47 - go func() {
48 - defer close(out)
49 - defer close(errs)
50 -
51 - // all-chunks loop (keep creating chunks)
52 - for {
53 - b, err := s.NextBytes()
54 - if err != nil {
55 - errs <- err
56 - return
57 - }
58 -
59 - out <- b
60 - }
61 - }()
62 - return out, errs
63 -}
64 -
65 -type sizeSplitterv2 struct {
66 - r io.Reader
67 - size uint32
68 - err error
69 -}
70 -
71 -// NewSizeSplitter returns a new size-based Splitter with the given block size.
72 -func NewSizeSplitter(r io.Reader, size int64) Splitter {
73 - return &sizeSplitterv2{
74 - r: r,
75 - size: uint32(size),
76 - }
77 -}
78 -
79 -// NextBytes produces a new chunk.
80 -func (ss *sizeSplitterv2) NextBytes() ([]byte, error) {
81 - if ss.err != nil {
82 - return nil, ss.err
83 - }
84 -
85 - full := mpool.ByteSlicePool.Get(ss.size).([]byte)[:ss.size]
86 - n, err := io.ReadFull(ss.r, full)
87 - switch err {
88 - case io.ErrUnexpectedEOF:
89 - ss.err = io.EOF
90 - small := make([]byte, n)
91 - copy(small, full)
92 - mpool.ByteSlicePool.Put(ss.size, full)
93 - return small, nil
94 - case nil:
95 - return full, nil
96 - default:
97 - mpool.ByteSlicePool.Put(ss.size, full)
98 - return nil, err
99 - }
100 -}
101 -
102 -// Reader returns the io.Reader associated to this Splitter.
103 -func (ss *sizeSplitterv2) Reader() io.Reader {
104 - return ss.r
105 -}
importer/chunk/splitting_test.go deleted
-120
@@ -1,120 +0,0 @@
1 -package chunk
2 -
3 -import (
4 - "bytes"
5 - "io"
6 - "testing"
7 -
8 - u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
9 -)
10 -
11 -func randBuf(t *testing.T, size int) []byte {
12 - buf := make([]byte, size)
13 - if _, err := u.NewTimeSeededRand().Read(buf); err != nil {
14 - t.Fatal("failed to read enough randomness")
15 - }
16 - return buf
17 -}
18 -
19 -func copyBuf(buf []byte) []byte {
20 - cpy := make([]byte, len(buf))
21 - copy(cpy, buf)
22 - return cpy
23 -}
24 -
25 -func TestSizeSplitterOverAllocate(t *testing.T) {
26 - max := 1000
27 - r := bytes.NewReader(randBuf(t, max))
28 - chunksize := int64(1024 * 256)
29 - splitter := NewSizeSplitter(r, chunksize)
30 - chunk, err := splitter.NextBytes()
31 - if err != nil {
32 - t.Fatal(err)
33 - }
34 - if cap(chunk) > len(chunk) {
35 - t.Fatal("chunk capacity too large")
36 - }
37 -}
38 -
39 -func TestSizeSplitterIsDeterministic(t *testing.T) {
40 - if testing.Short() {
41 - t.SkipNow()
42 - }
43 -
44 - test := func() {
45 - bufR := randBuf(t, 10000000) // crank this up to satisfy yourself.
46 - bufA := copyBuf(bufR)
47 - bufB := copyBuf(bufR)
48 -
49 - chunksA, _ := Chan(DefaultSplitter(bytes.NewReader(bufA)))
50 - chunksB, _ := Chan(DefaultSplitter(bytes.NewReader(bufB)))
51 -
52 - for n := 0; ; n++ {
53 - a, moreA := <-chunksA
54 - b, moreB := <-chunksB
55 -
56 - if !moreA {
57 - if moreB {
58 - t.Fatal("A ended, B didnt.")
59 - }
60 - return
61 - }
62 -
63 - if !bytes.Equal(a, b) {
64 - t.Fatalf("chunk %d not equal", n)
65 - }
66 - }
67 - }
68 -
69 - for run := 0; run < 1; run++ { // crank this up to satisfy yourself.
70 - test()
71 - }
72 -}
73 -
74 -func TestSizeSplitterFillsChunks(t *testing.T) {
75 - if testing.Short() {
76 - t.SkipNow()
77 - }
78 -
79 - max := 10000000
80 - b := randBuf(t, max)
81 - r := &clipReader{r: bytes.NewReader(b), size: 4000}
82 - chunksize := int64(1024 * 256)
83 - c, _ := Chan(NewSizeSplitter(r, chunksize))
84 -
85 - sofar := 0
86 - whole := make([]byte, max)
87 - for chunk := range c {
88 -
89 - bc := b[sofar : sofar+len(chunk)]
90 - if !bytes.Equal(bc, chunk) {
91 - t.Fatalf("chunk not correct: (sofar: %d) %d != %d, %v != %v", sofar, len(bc), len(chunk), bc[:100], chunk[:100])
92 - }
93 -
94 - copy(whole[sofar:], chunk)
95 -
96 - sofar += len(chunk)
97 - if sofar != max && len(chunk) < int(chunksize) {
98 - t.Fatal("sizesplitter split at a smaller size")
99 - }
100 - }
101 -
102 - if !bytes.Equal(b, whole) {
103 - t.Fatal("splitter did not split right")
104 - }
105 -}
106 -
107 -type clipReader struct {
108 - size int
109 - r io.Reader
110 -}
111 -
112 -func (s *clipReader) Read(buf []byte) (int, error) {
113 -
114 - // clip the incoming buffer to produce smaller chunks
115 - if len(buf) > s.size {
116 - buf = buf[:s.size]
117 - }
118 -
119 - return s.r.Read(buf)
120 -}
importer/helpers/dagbuilder.go
+1 -1
@@ -5,10 +5,10 @@ import (
5 "io"
6 "os"
7
8 - "github.com/ipfs/go-ipfs/importer/chunk"
8 dag "github.com/ipfs/go-ipfs/merkledag"
9 ft "github.com/ipfs/go-ipfs/unixfs"
10
11 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
12 cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
13 files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files"
14 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
importer/importer.go
+1 -1
@@ -6,11 +6,11 @@ import (
6 "fmt"
7 "os"
8
9 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
10 "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files"
11 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
12
13 bal "github.com/ipfs/go-ipfs/importer/balanced"
13 - "github.com/ipfs/go-ipfs/importer/chunk"
14 h "github.com/ipfs/go-ipfs/importer/helpers"
15 trickle "github.com/ipfs/go-ipfs/importer/trickle"
16 )
importer/importer_test.go
+1 -1
@@ -7,9 +7,9 @@ import (
7 "io/ioutil"
8 "testing"
9
10 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
10 mdtest "github.com/ipfs/go-ipfs/merkledag/test"
11 uio "github.com/ipfs/go-ipfs/unixfs/io"
12 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
13
14 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
15 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
importer/trickle/trickle_test.go
+1 -1
@@ -9,12 +9,12 @@ import (
9 mrand "math/rand"
10 "testing"
11
12 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
12 h "github.com/ipfs/go-ipfs/importer/helpers"
13 merkledag "github.com/ipfs/go-ipfs/merkledag"
14 mdtest "github.com/ipfs/go-ipfs/merkledag/test"
15 ft "github.com/ipfs/go-ipfs/unixfs"
16 uio "github.com/ipfs/go-ipfs/unixfs/io"
17 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
18
19 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
20 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
merkledag/merkledag_test.go
+1 -1
@@ -17,13 +17,13 @@ import (
17 bstest "github.com/ipfs/go-ipfs/blockservice/test"
18 offline "github.com/ipfs/go-ipfs/exchange/offline"
19 imp "github.com/ipfs/go-ipfs/importer"
20 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
20 . "github.com/ipfs/go-ipfs/merkledag"
21 mdpb "github.com/ipfs/go-ipfs/merkledag/pb"
22 dstest "github.com/ipfs/go-ipfs/merkledag/test"
23 uio "github.com/ipfs/go-ipfs/unixfs/io"
24
25 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
26 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
27 cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
28 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
29 blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format"
mfs/file.go
+1 -1
@@ -5,10 +5,10 @@ import (
5 "fmt"
6 "sync"
7
8 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
8 dag "github.com/ipfs/go-ipfs/merkledag"
9 ft "github.com/ipfs/go-ipfs/unixfs"
10 mod "github.com/ipfs/go-ipfs/unixfs/mod"
11 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
12
13 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
14 )
mfs/mfs_test.go
+1 -1
@@ -18,11 +18,11 @@ import (
18 bserv "github.com/ipfs/go-ipfs/blockservice"
19 offline "github.com/ipfs/go-ipfs/exchange/offline"
20 importer "github.com/ipfs/go-ipfs/importer"
21 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
21 dag "github.com/ipfs/go-ipfs/merkledag"
22 "github.com/ipfs/go-ipfs/path"
23 ft "github.com/ipfs/go-ipfs/unixfs"
24 uio "github.com/ipfs/go-ipfs/unixfs/io"
25 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
26
27 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
28 ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore"
package.json
+5
@@ -521,6 +521,11 @@
521 "hash": "Qmb3jLEFAQrqdVgWUajqEyuuDoavkSq1XQXz6tWdFWF995",
522 "name": "go-ipfs-posinfo",
523 "version": "0.0.1"
524 + },
525 + "author": "hsanjuan",
526 + "hash": "QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd",
527 + "name": "go-ipfs-chunker",
528 + "version": "0.0.1"
529 }
530 ],
531 "gxVersion": "0.10.0",
tar/format.go
+1 -1
@@ -9,11 +9,11 @@ import (
9 "strings"
10
11 importer "github.com/ipfs/go-ipfs/importer"
12 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
12 dag "github.com/ipfs/go-ipfs/merkledag"
13 dagutil "github.com/ipfs/go-ipfs/merkledag/utils"
14 path "github.com/ipfs/go-ipfs/path"
15 uio "github.com/ipfs/go-ipfs/unixfs/io"
16 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
17
18 logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log"
19 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
unixfs/mod/dagmodifier.go
+1 -1
@@ -8,12 +8,12 @@ import (
8 "errors"
9 "io"
10
11 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
11 help "github.com/ipfs/go-ipfs/importer/helpers"
12 trickle "github.com/ipfs/go-ipfs/importer/trickle"
13 mdag "github.com/ipfs/go-ipfs/merkledag"
14 ft "github.com/ipfs/go-ipfs/unixfs"
15 uio "github.com/ipfs/go-ipfs/unixfs/io"
16 + chunk "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
17
18 proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto"
19 cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
unixfs/test/utils.go
+1 -1
@@ -8,12 +8,12 @@ import (
8 "io/ioutil"
9 "testing"
10
11 - "github.com/ipfs/go-ipfs/importer/chunk"
11 h "github.com/ipfs/go-ipfs/importer/helpers"
12 trickle "github.com/ipfs/go-ipfs/importer/trickle"
13 mdag "github.com/ipfs/go-ipfs/merkledag"
14 mdagmock "github.com/ipfs/go-ipfs/merkledag/test"
15 ft "github.com/ipfs/go-ipfs/unixfs"
16 + "gx/ipfs/QmQXcAyrC4VBu9ZBqxoCthPot9PNhb4Uiw6iBDfQXudZJd/go-ipfs-chunker"
17
18 u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
19 mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash"