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-dms3
Commits
6da12b53
Commit
6da12b53
authored
Apr 23, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address comments from CR
parent
2c1c48a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
core/pathresolver.go
core/pathresolver.go
+6
-1
path/path.go
path/path.go
+2
-2
test/sharness/t0101-iptb-name.sh
test/sharness/t0101-iptb-name.sh
+3
-3
No files found.
core/pathresolver.go
View file @
6da12b53
...
...
@@ -44,7 +44,12 @@ func resolveRecurse(n *IpfsNode, p path.Path, depth int) (*merkledag.Node, error
return
nil
,
err
}
return
resolveRecurse
(
n
,
path
.
FromSegments
(
append
(
respath
.
Segments
(),
extensions
...
)
...
),
depth
+
1
)
segments
:=
append
(
respath
.
Segments
(),
extensions
...
)
respath
,
err
=
path
.
FromSegments
(
segments
...
)
if
err
!=
nil
{
return
nil
,
err
}
return
resolveRecurse
(
n
,
respath
,
depth
+
1
)
}
// ok, we have an ipfs path now (or what we'll treat as one)
...
...
path/path.go
View file @
6da12b53
...
...
@@ -44,12 +44,12 @@ func (p Path) String() string {
return
string
(
p
)
}
func
FromSegments
(
seg
...
string
)
Path
{
func
FromSegments
(
seg
...
string
)
(
Path
,
error
)
{
var
pref
string
if
seg
[
0
]
==
"ipfs"
||
seg
[
0
]
==
"ipns"
{
pref
=
"/"
}
return
Path
(
pref
+
strings
.
Join
(
seg
,
"/"
))
return
Parse
Path
(
pref
+
strings
.
Join
(
seg
,
"/"
))
}
func
ParsePath
(
txt
string
)
(
Path
,
error
)
{
...
...
test/sharness/t0101-iptb-name.sh
View file @
6da12b53
...
...
@@ -16,7 +16,7 @@ test_expect_success "set up an iptb cluster" '
'
test_expect_success
"add an obect on one node"
'
export IPFS_PATH="$IPTB_ROOT/1"
export IPFS_PATH="$IPTB_ROOT/1"
&&
echo "ipns is super fun" > file &&
HASH_FILE=`ipfs add -q file`
'
...
...
@@ -26,13 +26,13 @@ test_expect_success "publish that object as an ipns entry" '
'
test_expect_success
"add an entry on another node pointing to that one"
'
export IPFS_PATH="$IPTB_ROOT/2"
export IPFS_PATH="$IPTB_ROOT/2"
&&
NODE1_ID=`iptb get id 1` &&
ipfs name publish /ipns/$NODE1_ID
'
test_expect_success
"cat that entry on a third node"
'
export IPFS_PATH="$IPTB_ROOT/3"
export IPFS_PATH="$IPTB_ROOT/3"
&&
NODE2_ID=`iptb get id 2` &&
ipfs cat /ipns/$NODE2_ID > output
'
...
...
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