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
24224979
Commit
24224979
authored
10 years ago
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(bitswap:msg) add ToNet() method
parent
2f4175a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
bitswap/message.go
bitswap/message.go
+5
-0
No files found.
bitswap/message.go
View file @
24224979
...
...
@@ -2,6 +2,7 @@ package bitswap
import
(
blocks
"github.com/jbenet/go-ipfs/blocks"
nm
"github.com/jbenet/go-ipfs/net/message"
swarm
"github.com/jbenet/go-ipfs/net/swarm"
peer
"github.com/jbenet/go-ipfs/peer"
u
"github.com/jbenet/go-ipfs/util"
...
...
@@ -36,3 +37,7 @@ func (m *message) ToProto() *PBMessage {
func
(
m
*
message
)
ToSwarm
(
p
*
peer
.
Peer
)
*
swarm
.
Message
{
return
swarm
.
NewMessage
(
p
,
m
.
ToProto
())
}
func
(
m
*
message
)
ToNet
(
p
*
peer
.
Peer
)
(
nm
.
NetMessage
,
error
)
{
return
nm
.
FromObject
(
p
,
m
.
ToProto
())
}
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