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
f3733873
Commit
f3733873
authored
10 years ago
by
Matt Bell
Committed by
Juan Batiz-Benet
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Fixed 'object get' dagnode output format
parent
f1c788d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
core/commands2/object.go
core/commands2/object.go
+20
-2
No files found.
core/commands2/object.go
View file @
f3733873
...
...
@@ -17,6 +17,11 @@ var ErrObjectTooLarge = errors.New("input object was too large. limit is 512kbyt
const
inputLimit
=
512
*
1024
type
Node
struct
{
Links
[]
Link
Data
[]
byte
}
var
objectCmd
=
&
cmds
.
Command
{
Description
:
"Interact with ipfs objects"
,
Help
:
`'ipfs object' is a plumbing command used to manipulate DAG objects directly.`
,
...
...
@@ -121,9 +126,22 @@ This command outputs data in the following encodings:
return
}
res
.
SetOutput
(
object
)
node
:=
&
Node
{
Links
:
make
([]
Link
,
len
(
object
.
Links
)),
Data
:
object
.
Data
,
}
for
i
,
link
:=
range
object
.
Links
{
node
.
Links
[
i
]
=
Link
{
Hash
:
link
.
Hash
.
B58String
(),
Name
:
link
.
Name
,
Size
:
link
.
Size
,
}
}
res
.
SetOutput
(
node
)
},
Type
:
&
dag
.
Node
{},
Type
:
&
Node
{},
Marshallers
:
map
[
cmds
.
EncodingType
]
cmds
.
Marshaller
{
cmds
.
EncodingType
(
"protobuf"
)
:
func
(
res
cmds
.
Response
)
([]
byte
,
error
)
{
object
:=
res
.
Output
()
.
(
*
dag
.
Node
)
...
...
This diff is collapsed.
Click to expand it.
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