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
eddf3ec3
Commit
eddf3ec3
authored
Dec 13, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merkledag: fix json marshalling of pbnode
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
9eb1a21c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
node.go
node.go
+10
-0
No files found.
node.go
View file @
eddf3ec3
...
@@ -2,6 +2,7 @@ package merkledag
...
@@ -2,6 +2,7 @@ package merkledag
import
(
import
(
"context"
"context"
"encoding/json"
"fmt"
"fmt"
node
"gx/ipfs/QmRSU5EqqWVZSNdbU51yXmVoF1uNw3JgTNB6RaiL7DZM16/go-ipld-node"
node
"gx/ipfs/QmRSU5EqqWVZSNdbU51yXmVoF1uNw3JgTNB6RaiL7DZM16/go-ipld-node"
...
@@ -228,6 +229,15 @@ func (n *ProtoNode) Loggable() map[string]interface{} {
...
@@ -228,6 +229,15 @@ func (n *ProtoNode) Loggable() map[string]interface{} {
}
}
}
}
func
(
n
*
ProtoNode
)
MarshalJSON
()
([]
byte
,
error
)
{
out
:=
map
[
string
]
interface
{}{
"data"
:
n
.
data
,
"links"
:
n
.
links
,
}
return
json
.
Marshal
(
out
)
}
func
(
n
*
ProtoNode
)
Cid
()
*
cid
.
Cid
{
func
(
n
*
ProtoNode
)
Cid
()
*
cid
.
Cid
{
if
n
.
encoded
!=
nil
&&
n
.
cached
!=
nil
{
if
n
.
encoded
!=
nil
&&
n
.
cached
!=
nil
{
return
n
.
cached
return
n
.
cached
...
...
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