@cryptotaxi247 / kubo / commits / 5d90aa2a8

Docs: golint-ify "importers" module

This fixes all golint warnings in the importers module, adding documentation and module descriptions. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>

Hector Sanjuan committed Feb 1, 2018 at 23:39 UTC 5d90aa2a8ffc5fabaf482ddc4f8441b5eaaa226d
14 files changed +139 -55
core/coreunix/add.go
+2 -2
@@ -148,10 +148,10 @@ func (adder *Adder) add(reader io.Reader) (ipld.Node, error) {
148 }
149
150 if adder.Trickle {
151 - return trickle.TrickleLayout(params.New(chnk))
151 + return trickle.Layout(params.New(chnk))
152 }
153
154 - return balanced.BalancedLayout(params.New(chnk))
154 + return balanced.Layout(params.New(chnk))
155 }
156
157 // RootNode returns the root node of the Added.
importer/balanced/builder.go
+20 -2
@@ -1,3 +1,18 @@
1 +// Package balanced provides methods to build balanced DAGs.
2 +// In a balanced DAG, nodes are added to a single root
3 +// until the maximum number of links is reached (with leaves
4 +// being at depth 0). Then, a new root is created, and points to the
5 +// old root, and incorporates a new child, which proceeds to be
6 +// filled up (link) to more leaves. In all cases, the Data (chunks)
7 +// is stored only at the leaves, with the rest of nodes only
8 +// storing links to their children.
9 +//
10 +// In a balanced DAG, nodes fill their link capacity before
11 +// creating new ones, thus depth only increases when the
12 +// current tree is completely full.
13 +//
14 +// Balanced DAGs are generalistic DAGs in which all leaves
15 +// are at the same distance from the root.
16 package balanced
17
18 import (
@@ -8,8 +23,11 @@ import (
23 ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
24 )
25
11 -func BalancedLayout(db *h.DagBuilderHelper) (ipld.Node, error) {
12 - var offset uint64 = 0
26 +// Layout builds a balanced DAG. Data is stored at the leaves
27 +// and depth only increases when the tree is full, that is, when
28 +// the root node has reached the maximum number of links.
29 +func Layout(db *h.DagBuilderHelper) (ipld.Node, error) {
30 + var offset uint64
31 var root *h.UnixfsNode
32 for level := 0; !db.Done(); level++ {
33
importer/chunk/parse.go
+3
@@ -8,6 +8,9 @@ import (
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":
importer/chunk/rabin.go
+9
@@ -7,13 +7,18 @@ import (
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)
@@ -21,6 +26,8 @@ func NewRabin(r io.Reader, avgBlkSize uint64) *Rabin {
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)
@@ -31,6 +38,7 @@ func NewRabinMinMax(r io.Reader, min, avg, max uint64) *Rabin {
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 {
@@ -40,6 +48,7 @@ func (r *Rabin) NextBytes() ([]byte, error) {
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
+1 -1
@@ -68,7 +68,7 @@ func TestRabinChunkReuse(t *testing.T) {
68 ch2 := chunkData(t, data)
69
70 var extra int
71 - for k, _ := range ch2 {
71 + for k := range ch2 {
72 _, ok := ch1[k]
73 if !ok {
74 extra++
importer/chunk/splitting.go
+16 -1
@@ -1,4 +1,7 @@
1 -// package chunk implements streaming block splitters
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 (
@@ -10,25 +13,34 @@ import (
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)
@@ -56,6 +68,7 @@ type sizeSplitterv2 struct {
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,
@@ -63,6 +76,7 @@ func NewSizeSplitter(r io.Reader, size int64) Splitter {
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
@@ -85,6 +99,7 @@ func (ss *sizeSplitterv2) NextBytes() ([]byte, error) {
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/helpers/dagbuilder.go
+30 -20
@@ -29,6 +29,8 @@ type DagBuilderHelper struct {
29 prefix *cid.Prefix
30 }
31
32 +// DagBuilderParams wraps configuration options to create a DagBuilderHelper
33 +// from a chunk.Splitter.
34 type DagBuilderParams struct {
35 // Maximum number of links per intermediate node
36 Maxlinks int
@@ -48,8 +50,8 @@ type DagBuilderParams struct {
50 NoCopy bool
51 }
52
51 -// Generate a new DagBuilderHelper from the given params, which data source comes
52 -// from chunks object
53 +// New generates a new DagBuilderHelper from the given params and a given
54 +// chunk.Splitter as data source.
55 func (dbp *DagBuilderParams) New(spl chunk.Splitter) *DagBuilderHelper {
56 db := &DagBuilderHelper{
57 dserv: dbp.Dagserv,
@@ -94,16 +96,15 @@ func (db *DagBuilderHelper) Done() bool {
96
97 // Next returns the next chunk of data to be inserted into the dag
98 // if it returns nil, that signifies that the stream is at an end, and
97 -// that the current building operation should finish
99 +// that the current building operation should finish.
100 func (db *DagBuilderHelper) Next() ([]byte, error) {
101 db.prepareNext() // idempotent
102 d := db.nextData
103 db.nextData = nil // signal we've consumed it
104 if db.recvdErr != nil {
105 return nil, db.recvdErr
104 - } else {
105 - return d, nil
106 }
107 + return d, nil
108 }
109
110 // GetDagServ returns the dagservice object this Helper is using
@@ -132,8 +133,7 @@ func (db *DagBuilderHelper) newUnixfsBlock() *UnixfsNode {
133 }
134
135 // FillNodeLayer will add datanodes as children to the give node until
135 -// at most db.indirSize ndoes are added
136 -//
136 +// at most db.indirSize nodes are added.
137 func (db *DagBuilderHelper) FillNodeLayer(node *UnixfsNode) error {
138
139 // while we have room AND we're not done
@@ -151,6 +151,9 @@ func (db *DagBuilderHelper) FillNodeLayer(node *UnixfsNode) error {
151 return nil
152 }
153
154 +// GetNextDataNode builds a UnixFsNode with the data obtained from the
155 +// Splitter, given the constraints (BlockSizeLimit, RawLeaves) specified
156 +// when creating the DagBuilderHelper.
157 func (db *DagBuilderHelper) GetNextDataNode() (*UnixfsNode, error) {
158 data, err := db.Next()
159 if err != nil {
@@ -171,29 +174,31 @@ func (db *DagBuilderHelper) GetNextDataNode() (*UnixfsNode, error) {
174 rawnode: dag.NewRawNode(data),
175 raw: true,
176 }, nil
174 - } else {
175 - rawnode, err := dag.NewRawNodeWPrefix(data, *db.prefix)
176 - if err != nil {
177 - return nil, err
178 - }
179 - return &UnixfsNode{
180 - rawnode: rawnode,
181 - raw: true,
182 - }, nil
177 }
184 - } else {
185 - blk := db.newUnixfsBlock()
186 - blk.SetData(data)
187 - return blk, nil
178 + rawnode, err := dag.NewRawNodeWPrefix(data, *db.prefix)
179 + if err != nil {
180 + return nil, err
181 + }
182 + return &UnixfsNode{
183 + rawnode: rawnode,
184 + raw: true,
185 + }, nil
186 }
187 +
188 + blk := db.newUnixfsBlock()
189 + blk.SetData(data)
190 + return blk, nil
191 }
192
193 +// SetPosInfo sets the offset information of a node using the fullpath and stat
194 +// from the DagBuilderHelper.
195 func (db *DagBuilderHelper) SetPosInfo(node *UnixfsNode, offset uint64) {
196 if db.fullPath != "" {
197 node.SetPosInfo(offset, db.fullPath, db.stat)
198 }
199 }
200
201 +// Add sends a node to the DAGService, and returns it.
202 func (db *DagBuilderHelper) Add(node *UnixfsNode) (ipld.Node, error) {
203 dn, err := node.GetDagNode()
204 if err != nil {
@@ -208,10 +213,15 @@ func (db *DagBuilderHelper) Add(node *UnixfsNode) (ipld.Node, error) {
213 return dn, nil
214 }
215
216 +// Maxlinks returns the configured maximum number for links
217 +// for nodes built with this helper.
218 func (db *DagBuilderHelper) Maxlinks() int {
219 return db.maxlinks
220 }
221
222 +// Close has the DAGServce perform a batch Commit operation.
223 +// It should be called at the end of the building process to make
224 +// sure all data is persisted.
225 func (db *DagBuilderHelper) Close() error {
226 return db.batch.Commit()
227 }
importer/helpers/helpers.go
+11 -4
@@ -70,7 +70,8 @@ func (n *UnixfsNode) NumChildren() int {
70 return n.ufmt.NumChildren()
71 }
72
73 -// Set replaces this UnixfsNode with another UnixfsNode
73 +// Set replaces the current UnixfsNode with another one. It performs
74 +// a shallow copy.
75 func (n *UnixfsNode) Set(other *UnixfsNode) {
76 n.node = other.node
77 n.raw = other.raw
@@ -97,7 +98,7 @@ func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds ipld.DAGService) (*
98
99 // AddChild adds the given UnixfsNode as a child of the receiver.
100 // The passed in DagBuilderHelper is used to store the child node an
100 -// pin it locally so it doesnt get lost
101 +// pin it locally so it doesnt get lost.
102 func (n *UnixfsNode) AddChild(child *UnixfsNode, db *DagBuilderHelper) error {
103 n.ufmt.AddBlockSize(child.FileSize())
104
@@ -118,16 +119,20 @@ func (n *UnixfsNode) AddChild(child *UnixfsNode, db *DagBuilderHelper) error {
119 return err
120 }
121
121 -// RemoveChild removes the child node at the given index
122 +// RemoveChild deletes the child node at the given index.
123 func (n *UnixfsNode) RemoveChild(index int, dbh *DagBuilderHelper) {
124 n.ufmt.RemoveBlockSize(index)
125 n.node.SetLinks(append(n.node.Links()[:index], n.node.Links()[index+1:]...))
126 }
127
128 +// SetData stores data in this node.
129 func (n *UnixfsNode) SetData(data []byte) {
130 n.ufmt.Data = data
131 }
132
133 +// FileSize returns the total file size of this tree (including children)
134 +// In the case of raw nodes, it returns the length of the
135 +// raw data.
136 func (n *UnixfsNode) FileSize() uint64 {
137 if n.raw {
138 return uint64(len(n.rawnode.RawData()))
@@ -135,6 +140,8 @@ func (n *UnixfsNode) FileSize() uint64 {
140 return n.ufmt.FileSize()
141 }
142
143 +// SetPosInfo sets information about the offset of the data of this node in a
144 +// filesystem file.
145 func (n *UnixfsNode) SetPosInfo(offset uint64, fullPath string, stat os.FileInfo) {
146 n.posInfo = &pi.PosInfo{
147 Offset: offset,
@@ -144,7 +151,7 @@ func (n *UnixfsNode) SetPosInfo(offset uint64, fullPath string, stat os.FileInfo
151 }
152
153 // GetDagNode fills out the proper formatting for the unixfs node
147 -// inside of a DAG node and returns the dag node
154 +// inside of a DAG node and returns the dag node.
155 func (n *UnixfsNode) GetDagNode() (ipld.Node, error) {
156 nd, err := n.getBaseDagNode()
157 if err != nil {
importer/importer.go
+11 -9
@@ -6,17 +6,18 @@ import (
6 "fmt"
7 "os"
8
9 + "gx/ipfs/QmQp2a2Hhb7F6eK2A5hN8f9aJy4mtkEikL9Zj4cgB7d1dD/go-ipfs-cmdkit/files"
10 +
11 + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
12 +
13 bal "github.com/ipfs/go-ipfs/importer/balanced"
14 "github.com/ipfs/go-ipfs/importer/chunk"
15 h "github.com/ipfs/go-ipfs/importer/helpers"
16 trickle "github.com/ipfs/go-ipfs/importer/trickle"
13 - "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files"
14 -
15 - ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
17 )
18
19 // BuildDagFromFile builds a DAG from the given file, writing created blocks to
19 -// disk as they are created
20 +// disk as they are created.
21 func BuildDagFromFile(fpath string, ds ipld.DAGService) (ipld.Node, error) {
22 stat, err := os.Lstat(fpath)
23 if err != nil {
@@ -36,23 +37,24 @@ func BuildDagFromFile(fpath string, ds ipld.DAGService) (ipld.Node, error) {
37 return BuildDagFromReader(ds, chunk.DefaultSplitter(f))
38 }
39
39 -// BuildDagFromReader builds a DAG from the chunks returned by the given chunk
40 -// splitter.
40 +// BuildDagFromReader creates a DAG given a DAGService and a Splitter
41 +// implementation (Splitters are io.Readers), using a Balanced layout.
42 func BuildDagFromReader(ds ipld.DAGService, spl chunk.Splitter) (ipld.Node, error) {
43 dbp := h.DagBuilderParams{
44 Dagserv: ds,
45 Maxlinks: h.DefaultLinksPerBlock,
46 }
47
47 - return bal.BalancedLayout(dbp.New(spl))
48 + return bal.Layout(dbp.New(spl))
49 }
50
50 -// BuildTrickleDagFromReader is similar to BuildDagFromReader but uses the trickle layout.
51 +// BuildTrickleDagFromReader creates a DAG given a DAGService and a Splitter
52 +// implementation (Splitters are io.Readers), using a Trickle Layout.
53 func BuildTrickleDagFromReader(ds ipld.DAGService, spl chunk.Splitter) (ipld.Node, error) {
54 dbp := h.DagBuilderParams{
55 Dagserv: ds,
56 Maxlinks: h.DefaultLinksPerBlock,
57 }
58
57 - return trickle.TrickleLayout(dbp.New(spl))
59 + return trickle.Layout(dbp.New(spl))
60 }
importer/trickle/trickle_test.go
+5 -5
@@ -39,7 +39,7 @@ func buildTestDag(ds ipld.DAGService, spl chunk.Splitter, rawLeaves UseRawLeaves
39 RawLeaves: bool(rawLeaves),
40 }
41
42 - nd, err := TrickleLayout(dbp.New(spl))
42 + nd, err := Layout(dbp.New(spl))
43 if err != nil {
44 return nil, err
45 }
@@ -503,7 +503,7 @@ func testAppend(t *testing.T, rawLeaves UseRawLeaves) {
503 r := bytes.NewReader(should[nbytes/2:])
504
505 ctx := context.Background()
506 - nnode, err := TrickleAppend(ctx, nd, dbp.New(chunk.NewSizeSplitter(r, 500)))
506 + nnode, err := Append(ctx, nd, dbp.New(chunk.NewSizeSplitter(r, 500)))
507 if err != nil {
508 t.Fatal(err)
509 }
@@ -564,7 +564,7 @@ func testMultipleAppends(t *testing.T, rawLeaves UseRawLeaves) {
564 ctx := context.Background()
565 for i := 0; i < len(should); i++ {
566
567 - nnode, err := TrickleAppend(ctx, nd, dbp.New(spl(bytes.NewReader(should[i:i+1]))))
567 + nnode, err := Append(ctx, nd, dbp.New(spl(bytes.NewReader(should[i:i+1]))))
568 if err != nil {
569 t.Fatal(err)
570 }
@@ -612,12 +612,12 @@ func TestAppendSingleBytesToEmpty(t *testing.T) {
612 spl := chunk.SizeSplitterGen(500)
613
614 ctx := context.Background()
615 - nnode, err := TrickleAppend(ctx, nd, dbp.New(spl(bytes.NewReader(data[:1]))))
615 + nnode, err := Append(ctx, nd, dbp.New(spl(bytes.NewReader(data[:1]))))
616 if err != nil {
617 t.Fatal(err)
618 }
619
620 - nnode, err = TrickleAppend(ctx, nnode, dbp.New(spl(bytes.NewReader(data[1:]))))
620 + nnode, err = Append(ctx, nnode, dbp.New(spl(bytes.NewReader(data[1:]))))
621 if err != nil {
622 t.Fatal(err)
623 }
importer/trickle/trickledag.go
+27 -9
@@ -1,3 +1,18 @@
1 +// Package trickle allows to build trickle DAGs.
2 +// In this type of DAG, non-leave nodes are first filled
3 +// with data leaves, and then incorporate "layers" of subtrees
4 +// as additional links.
5 +//
6 +// Each layer is a trickle sub-tree and is limited by an increasing
7 +// maxinum depth. Thus, the nodes first layer
8 +// can only hold leaves (depth 1) but subsequent layers can grow deeper.
9 +// By default, this module places 4 nodes per layer (that is, 4 subtrees
10 +// of the same maxinum depth before increasing it).
11 +//
12 +// Trickle DAGs are very good for sequentially reading data, as the
13 +// first data leaves are directly reachable from the root and those
14 +// coming next are always nearby. They are
15 +// suited for things like streaming applications.
16 package trickle
17
18 import (
@@ -18,7 +33,10 @@ import (
33 // improves seek speeds.
34 const layerRepeat = 4
35
21 -func TrickleLayout(db *h.DagBuilderHelper) (ipld.Node, error) {
36 +// Layout builds a new DAG with the trickle format using the provided
37 +// DagBuilderHelper. See the module's description for a more detailed
38 +// explanation.
39 +func Layout(db *h.DagBuilderHelper) (ipld.Node, error) {
40 root := db.NewUnixfsNode()
41 if err := db.FillNodeLayer(root); err != nil {
42 return nil, err
@@ -68,17 +86,17 @@ func fillTrickleRec(db *h.DagBuilderHelper, node *h.UnixfsNode, depth int) error
86 return nil
87 }
88
71 -// TrickleAppend appends the data in `db` to the dag, using the Trickledag format
72 -func TrickleAppend(ctx context.Context, basen ipld.Node, db *h.DagBuilderHelper) (out ipld.Node, err_out error) {
89 +// Append appends the data in `db` to the dag, using the Trickledag format
90 +func Append(ctx context.Context, basen ipld.Node, db *h.DagBuilderHelper) (out ipld.Node, errOut error) {
91 base, ok := basen.(*dag.ProtoNode)
92 if !ok {
93 return nil, dag.ErrNotProtobuf
94 }
95
96 defer func() {
79 - if err_out == nil {
97 + if errOut == nil {
98 if err := db.Close(); err != nil {
81 - err_out = err
99 + errOut = err
100 }
101 }
102 }()
@@ -148,7 +166,7 @@ func appendFillLastChild(ctx context.Context, ufsn *h.UnixfsNode, depth int, lay
166 }
167
168 // Fill out last child (may not be full tree)
151 - nchild, err := trickleAppendRec(ctx, lastChild, db, depth-1)
169 + nchild, err := appendRec(ctx, lastChild, db, depth-1)
170 if err != nil {
171 return err
172 }
@@ -179,8 +197,8 @@ func appendFillLastChild(ctx context.Context, ufsn *h.UnixfsNode, depth int, lay
197 return nil
198 }
199
182 -// recursive call for TrickleAppend
183 -func trickleAppendRec(ctx context.Context, ufsn *h.UnixfsNode, db *h.DagBuilderHelper, depth int) (*h.UnixfsNode, error) {
200 +// recursive call for Append
201 +func appendRec(ctx context.Context, ufsn *h.UnixfsNode, db *h.DagBuilderHelper, depth int) (*h.UnixfsNode, error) {
202 if depth == 0 || db.Done() {
203 return ufsn, nil
204 }
@@ -337,7 +355,7 @@ func verifyTDagRec(n ipld.Node, depth int, p VerifyParams) error {
355 // Recursive trickle dags
356 rdepth := ((i - p.Direct) / p.LayerRepeat) + 1
357 if rdepth >= depth && depth > 0 {
340 - return errors.New("Child dag was too deep!")
358 + return errors.New("child dag was too deep")
359 }
360 err := verifyTDagRec(child, rdepth, p)
361 if err != nil {
unixfs/format.go
+2
@@ -174,6 +174,8 @@ func (n *FSNode) GetBytes() ([]byte, error) {
174 return proto.Marshal(pbn)
175 }
176
177 +// FileSize returns the total size of this tree. That is, the size of
178 +// the data in this node plus the size of all its children.
179 func (n *FSNode) FileSize() uint64 {
180 return uint64(len(n.Data)) + n.subtotal
181 }
unixfs/mod/dagmodifier.go
+1 -1
@@ -362,7 +362,7 @@ func (dm *DagModifier) appendData(nd ipld.Node, spl chunk.Splitter) (ipld.Node,
362 Prefix: &dm.Prefix,
363 RawLeaves: dm.RawLeaves,
364 }
365 - return trickle.TrickleAppend(dm.ctx, nd, dbp.New(spl))
365 + return trickle.Append(dm.ctx, nd, dbp.New(spl))
366 default:
367 return nil, ErrNotUnixfs
368 }
unixfs/test/utils.go
+1 -1
@@ -63,7 +63,7 @@ func GetNode(t testing.TB, dserv ipld.DAGService, data []byte, opts NodeOpts) ip
63 RawLeaves: opts.RawLeavesUsed,
64 }
65
66 - node, err := trickle.TrickleLayout(dbp.New(SizeSplitterGen(500)(in)))
66 + node, err := trickle.Layout(dbp.New(SizeSplitterGen(500)(in)))
67 if err != nil {
68 t.Fatal(err)
69 }