packagebitswapimport(blocks"github.com/jbenet/go-ipfs/blocks"peer"github.com/jbenet/go-ipfs/peer"swarm"github.com/jbenet/go-ipfs/swarm"u"github.com/jbenet/go-ipfs/util")// message wraps a proto message for conveniencetypemessagestruct{pbPBMessage}funcnewMessageFromProto(pbPBMessage)*message{return&message{pb:pb}}funcnewMessage()*message{returnnew(message)}func(m*message)AppendWanted(ku.Key){m.pb.Wantlist=append(m.pb.Wantlist,string(k))}func(m*message)AppendBlock(b*blocks.Block){m.pb.Blocks=append(m.pb.Blocks,b.Data)}func(m*message)ToProto()*PBMessage{cp:=m.pbreturn&cp}func(m*message)ToSwarm(p*peer.Peer)*swarm.Message{returnswarm.NewMessage(p,m.ToProto())}