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
c1560bef
Commit
c1560bef
authored
Apr 22, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up core.Resolve a bit
parent
e3255f46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
core/commands/publish.go
core/commands/publish.go
+3
-5
path/path.go
path/path.go
+5
-1
No files found.
core/commands/publish.go
View file @
c1560bef
...
...
@@ -8,7 +8,6 @@ import (
cmds
"github.com/ipfs/go-ipfs/commands"
core
"github.com/ipfs/go-ipfs/core"
nsys
"github.com/ipfs/go-ipfs/namesys"
crypto
"github.com/ipfs/go-ipfs/p2p/crypto"
path
"github.com/ipfs/go-ipfs/path"
u
"github.com/ipfs/go-ipfs/util"
...
...
@@ -77,6 +76,7 @@ Publish an <ipfs-path> to another public key (not implemented):
// name = args[0]
pstr
=
args
[
1
]
res
.
SetError
(
errors
.
New
(
"keychains not yet implemented"
),
cmds
.
ErrNormal
)
return
case
1
:
// name = n.Identity.ID.String()
pstr
=
args
[
0
]
...
...
@@ -108,14 +108,12 @@ Publish an <ipfs-path> to another public key (not implemented):
func
publish
(
n
*
core
.
IpfsNode
,
k
crypto
.
PrivKey
,
ref
path
.
Path
)
(
*
IpnsEntry
,
error
)
{
// First, verify the path exists
_
,
err
:=
n
.
Resolver
.
Resolve
Path
(
ref
)
_
,
err
:=
core
.
Resolve
(
n
,
ref
)
if
err
!=
nil
{
return
nil
,
err
}
pub
:=
nsys
.
NewRoutingPublisher
(
n
.
Routing
)
err
=
pub
.
Publish
(
n
.
Context
(),
k
,
ref
)
err
=
n
.
Namesys
.
Publish
(
n
.
Context
(),
k
,
ref
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
path/path.go
View file @
c1560bef
...
...
@@ -45,7 +45,11 @@ func (p Path) String() string {
}
func
FromSegments
(
seg
...
string
)
Path
{
return
Path
(
strings
.
Join
(
seg
,
"/"
))
var
pref
string
if
seg
[
0
]
==
"ipfs"
||
seg
[
0
]
==
"ipns"
{
pref
=
"/"
}
return
Path
(
pref
+
strings
.
Join
(
seg
,
"/"
))
}
func
ParsePath
(
txt
string
)
(
Path
,
error
)
{
...
...
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