@cryptotaxi247 / kubo / commits / 70999886c

feat(bitswap:msg) define interfaces

Brian Tiger Chow committed Sep 12, 2014 at 19:08 UTC 70999886c583894710a97e3d70b9a986631c96f0
1 file changed +12
bitswap/message.go
+12
@@ -8,6 +8,18 @@ import (
8 u "github.com/jbenet/go-ipfs/util"
9 )
10
11 +type BitSwapMessage interface {
12 + AppendWanted(k u.Key)
13 + AppendBlock(b *blocks.Block)
14 + Exportable
15 +}
16 +
17 +type Exportable interface {
18 + ToProto() *PBMessage
19 + ToSwarm(p *peer.Peer) *swarm.Message
20 + ToNet(p *peer.Peer) (nm.NetMessage, error)
21 +}
22 +
23 // message wraps a proto message for convenience
24 type message struct {
25 pb PBMessage