From d94e764e4a3fd6dc3a59d729ef0e57b9bd2f6589 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Wed, 22 Oct 2014 04:24:39 -0700 Subject: [PATCH] refactor(net/service) move proto to internal pb package --- net/service/{ => internal/pb}/Makefile | 0 net/service/{ => internal/pb}/request.pb.go | 0 net/service/{ => internal/pb}/request.proto | 0 net/service/request.go | 5 +++-- 4 files changed, 3 insertions(+), 2 deletions(-) rename net/service/{ => internal/pb}/Makefile (100%) rename net/service/{ => internal/pb}/request.pb.go (100%) rename net/service/{ => internal/pb}/request.proto (100%) diff --git a/net/service/Makefile b/net/service/internal/pb/Makefile similarity index 100% rename from net/service/Makefile rename to net/service/internal/pb/Makefile diff --git a/net/service/request.pb.go b/net/service/internal/pb/request.pb.go similarity index 100% rename from net/service/request.pb.go rename to net/service/internal/pb/request.pb.go diff --git a/net/service/request.proto b/net/service/internal/pb/request.proto similarity index 100% rename from net/service/request.proto rename to net/service/internal/pb/request.proto diff --git a/net/service/request.go b/net/service/request.go index 0905e3a63..babf6b4d5 100644 --- a/net/service/request.go +++ b/net/service/request.go @@ -4,6 +4,7 @@ import ( crand "crypto/rand" msg "github.com/jbenet/go-ipfs/net/message" + pb "github.com/jbenet/go-ipfs/net/service/internal/pb" peer "github.com/jbenet/go-ipfs/peer" 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 { func wrapData(data []byte, rid RequestID) ([]byte, error) { // Marshal - pbm := new(PBRequest) + pbm := new(pb.PBRequest) pbm.Data = data pbm.Tag = rid b, err := proto.Marshal(pbm) @@ -117,7 +118,7 @@ func wrapData(data []byte, rid RequestID) ([]byte, error) { func unwrapData(data []byte) ([]byte, RequestID, error) { // Unmarshal - pbm := new(PBRequest) + pbm := new(pb.PBRequest) err := proto.Unmarshal(data, pbm) if err != nil { return nil, nil, err