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
09e47db6
Commit
09e47db6
authored
Jan 21, 2015
by
Mildred Ki'Lya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HTTP: add handlers to allow object creation and modification
parent
5f130e41
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 @
09e47db6
...
...
@@ -134,6 +134,16 @@ func (n *Node) Copy() *Node {
return
nnode
}
// UpdateNodeLink return a copy of the node with the link name set to point to
// that. If a link of the same name existed, it is removed.
func
(
n
*
Node
)
UpdateNodeLink
(
name
string
,
that
*
Node
)
(
*
Node
,
error
)
{
newnode
:=
n
.
Copy
()
err
:=
newnode
.
RemoveNodeLink
(
name
)
err
=
nil
// ignore error
err
=
newnode
.
AddNodeLink
(
name
,
that
)
return
newnode
,
err
}
// Size returns the total size of the data addressed by node,
// including the total sizes of references.
func
(
n
*
Node
)
Size
()
(
uint64
,
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