Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-merkledag
Commits
ff1df7aa
Commit
ff1df7aa
authored
Oct 24, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to new cid and ipld node packages
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
01a9d93f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
27 additions
and
19 deletions
+27
-19
coding.go
coding.go
+2
-2
merkledag.go
merkledag.go
+2
-2
merkledag_test.go
merkledag_test.go
+3
-3
node.go
node.go
+7
-3
node_test.go
node_test.go
+1
-1
raw.go
raw.go
+7
-3
traverse/traverse.go
traverse/traverse.go
+1
-1
traverse/traverse_test.go
traverse/traverse_test.go
+1
-1
utils/diff.go
utils/diff.go
+1
-1
utils/utils.go
utils/utils.go
+1
-1
utils/utils_test.go
utils/utils_test.go
+1
-1
No files found.
coding.go
View file @
ff1df7aa
...
...
@@ -6,8 +6,8 @@ import (
pb
"github.com/ipfs/go-ipfs/merkledag/pb"
cid
"gx/ipfs/Qm
XUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z/go-cid
"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB/go-ipld-node
"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g/go-ipld-node
"
cid
"gx/ipfs/Qm
Xfiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY/go-cid
"
u
"gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util"
)
...
...
merkledag.go
View file @
ff1df7aa
...
...
@@ -12,8 +12,8 @@ import (
offline
"github.com/ipfs/go-ipfs/exchange/offline"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
cid
"gx/ipfs/Qm
XUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z/go-cid
"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB/go-ipld-node
"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g/go-ipld-node
"
cid
"gx/ipfs/Qm
Xfiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY/go-cid
"
)
var
log
=
logging
.
Logger
(
"merkledag"
)
...
...
merkledag_test.go
View file @
ff1df7aa
...
...
@@ -21,9 +21,9 @@ import (
dstest
"github.com/ipfs/go-ipfs/merkledag/test"
uio
"github.com/ipfs/go-ipfs/unixfs/io"
cid
"gx/ipfs/QmXUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z/go-cid"
node
"gx/ipfs/QmU7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g/go-ipld-node"
cid
"gx/ipfs/QmXfiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY/go-cid"
key
"gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key"
node
"gx/ipfs/QmZx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB/go-ipld-node"
u
"gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util"
)
...
...
@@ -433,7 +433,7 @@ func TestProtoNodeResolve(t *testing.T) {
nd
:=
new
(
ProtoNode
)
nd
.
SetLinks
([]
*
node
.
Link
{{
Name
:
"foo"
}})
lnk
,
left
,
err
:=
nd
.
Resolve
([]
string
{
"foo"
,
"bar"
})
lnk
,
left
,
err
:=
nd
.
Resolve
Link
([]
string
{
"foo"
,
"bar"
})
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
node.go
View file @
ff1df7aa
...
...
@@ -4,10 +4,10 @@ import (
"context"
"fmt"
cid
"gx/ipfs/QmXUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z/go-cid"
node
"gx/ipfs/QmU7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g/go-ipld-node"
cid
"gx/ipfs/QmXfiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY/go-cid"
mh
"gx/ipfs/QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J/go-multihash"
key
"gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key"
node
"gx/ipfs/QmZx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB/go-ipld-node"
)
var
ErrNotProtobuf
=
fmt
.
Errorf
(
"expected protobuf dag node"
)
...
...
@@ -253,7 +253,11 @@ func (n *ProtoNode) SetLinks(links []*node.Link) {
n
.
links
=
links
}
func
(
n
*
ProtoNode
)
Resolve
(
path
[]
string
)
(
*
node
.
Link
,
[]
string
,
error
)
{
func
(
n
*
ProtoNode
)
Resolve
(
path
[]
string
)
(
interface
{},
[]
string
,
error
)
{
return
n
.
ResolveLink
(
path
)
}
func
(
n
*
ProtoNode
)
ResolveLink
(
path
[]
string
)
(
*
node
.
Link
,
[]
string
,
error
)
{
if
len
(
path
)
==
0
{
return
nil
,
nil
,
fmt
.
Errorf
(
"end of path, no more links to resolve"
)
}
...
...
node_test.go
View file @
ff1df7aa
...
...
@@ -7,7 +7,7 @@ import (
.
"github.com/ipfs/go-ipfs/merkledag"
mdtest
"github.com/ipfs/go-ipfs/merkledag/test"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB
/go-ipld-node"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g
/go-ipld-node"
)
func
TestRemoveLink
(
t
*
testing
.
T
)
{
...
...
raw.go
View file @
ff1df7aa
...
...
@@ -3,8 +3,8 @@ package merkledag
import
(
"github.com/ipfs/go-ipfs/blocks"
cid
"gx/ipfs/Qm
XUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z/go-cid
"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB/go-ipld-node
"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g/go-ipld-node
"
cid
"gx/ipfs/Qm
Xfiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY/go-cid
"
u
"gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util"
)
...
...
@@ -24,7 +24,11 @@ func (rn *RawNode) Links() []*node.Link {
return
nil
}
func
(
rn
*
RawNode
)
Resolve
(
path
[]
string
)
(
*
node
.
Link
,
[]
string
,
error
)
{
func
(
rn
*
RawNode
)
ResolveLink
(
path
[]
string
)
(
*
node
.
Link
,
[]
string
,
error
)
{
return
nil
,
nil
,
ErrLinkNotFound
}
func
(
rn
*
RawNode
)
Resolve
(
path
[]
string
)
(
interface
{},
[]
string
,
error
)
{
return
nil
,
nil
,
ErrLinkNotFound
}
...
...
traverse/traverse.go
View file @
ff1df7aa
...
...
@@ -5,7 +5,7 @@ import (
"context"
"errors"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB
/go-ipld-node"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g
/go-ipld-node"
)
// Order is an identifier for traversal algorithm orders
...
...
traverse/traverse_test.go
View file @
ff1df7aa
...
...
@@ -8,7 +8,7 @@ import (
mdag
"github.com/ipfs/go-ipfs/merkledag"
mdagtest
"github.com/ipfs/go-ipfs/merkledag/test"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB
/go-ipld-node"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g
/go-ipld-node"
)
func
TestDFSPreNoSkip
(
t
*
testing
.
T
)
{
...
...
utils/diff.go
View file @
ff1df7aa
...
...
@@ -7,7 +7,7 @@ import (
dag
"github.com/ipfs/go-ipfs/merkledag"
context
"context"
cid
"gx/ipfs/QmX
UuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z
/go-cid"
cid
"gx/ipfs/QmX
fiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY
/go-cid"
)
const
(
...
...
utils/utils.go
View file @
ff1df7aa
...
...
@@ -10,7 +10,7 @@ import (
dag
"github.com/ipfs/go-ipfs/merkledag"
path
"github.com/ipfs/go-ipfs/path"
node
"gx/ipfs/Qm
Zx42H5khbVQhV5odp66TApShV4XCujYazcvYduZ4TroB
/go-ipld-node"
node
"gx/ipfs/Qm
U7bFWQ793qmvNy7outdCaMfSDNk8uqhx4VNrxYj5fj5g
/go-ipld-node"
ds
"gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore"
syncds
"gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore/sync"
)
...
...
utils/utils_test.go
View file @
ff1df7aa
...
...
@@ -8,7 +8,7 @@ import (
path
"github.com/ipfs/go-ipfs/path"
context
"context"
cid
"gx/ipfs/QmX
UuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z
/go-cid"
cid
"gx/ipfs/QmX
fiyr2RWEXpVDdaYnD2HNiBk6UBddsvEP4RPfXb6nGqY
/go-cid"
)
func
TestAddLink
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment