@cryptotaxi247 / kubo / commits / d94e764e4

refactor(net/service) move proto to internal pb package

Brian Tiger Chow committed Oct 22, 2014 at 04:24 UTC d94e764e4a3fd6dc3a59d729ef0e57b9bd2f6589
4 files changed +3 -2
net/service/internal/pb/Makefile renamed
net/service/internal/pb/request.pb.go renamed
net/service/internal/pb/request.proto renamed
net/service/request.go
+3 -2
@@ -4,6 +4,7 @@ import (
4 crand "crypto/rand"
5
6 msg "github.com/jbenet/go-ipfs/net/message"
7 + pb "github.com/jbenet/go-ipfs/net/service/internal/pb"
8 peer "github.com/jbenet/go-ipfs/peer"
9
10 proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
@@ -104,7 +105,7 @@ func RequestKey(pid peer.ID, rid RequestID) string {
105
106 func wrapData(data []byte, rid RequestID) ([]byte, error) {
107 // Marshal
107 - pbm := new(PBRequest)
108 + pbm := new(pb.PBRequest)
109 pbm.Data = data
110 pbm.Tag = rid
111 b, err := proto.Marshal(pbm)
@@ -117,7 +118,7 @@ func wrapData(data []byte, rid RequestID) ([]byte, error) {
118
119 func unwrapData(data []byte) ([]byte, RequestID, error) {
120 // Unmarshal
120 - pbm := new(PBRequest)
121 + pbm := new(pb.PBRequest)
122 err := proto.Unmarshal(data, pbm)
123 if err != nil {
124 return nil, nil, err