fix(crypto) rename proto package -> crypto_pb, regen go file
+ add Makefile
Brian Tiger Chow committed
Oct 22, 2014 at 05:10 UTC
6e9e29b87deb5450cf837aabf24967d1bad2c4e5
3 files changed
+20
-10
crypto/internal/pb/Makefile
new
+10
@@ -0,0 +1,10 @@
1
+PB = $(wildcard *.proto)
2
+GO = $(PB:.proto=.pb.go)
3
+
4
+all: $(GO)
5
+
6
+%.pb.go: %.proto
7
+ protoc --gogo_out=. --proto_path=../../../../../../:/usr/local/opt/protobuf/include:. $<
8
+
9
+clean:
10
+ rm *.pb.go
crypto/internal/pb/crypto.pb.go
renamed
+9
-9
@@ -1,20 +1,20 @@
1
-// Code generated by protoc-gen-go.
2
-// source: encode.proto
1
+// Code generated by protoc-gen-gogo.
2
+// source: crypto.proto
3
// DO NOT EDIT!
4
5
/*
6
-Package crypto is a generated protocol buffer package.
6
+Package crypto_pb is a generated protocol buffer package.
7
8
It is generated from these files:
9
- encode.proto
9
+ crypto.proto
10
11
It has these top-level messages:
12
PBPublicKey
13
PBPrivateKey
14
*/
15
-package crypto
15
+package crypto_pb
16
17
-import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
17
+import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto"
18
import math "math"
19
20
// Reference imports to suppress errors if they are not otherwise used.
@@ -52,7 +52,7 @@ func (x *KeyType) UnmarshalJSON(data []byte) error {
52
}
53
54
type PBPublicKey struct {
55
- Type *KeyType `protobuf:"varint,1,req,enum=crypto.KeyType" json:"Type,omitempty"`
55
+ Type *KeyType `protobuf:"varint,1,req,enum=crypto.pb.KeyType" json:"Type,omitempty"`
56
Data []byte `protobuf:"bytes,2,req" json:"Data,omitempty"`
57
XXX_unrecognized []byte `json:"-"`
58
}
@@ -76,7 +76,7 @@ func (m *PBPublicKey) GetData() []byte {
76
}
77
78
type PBPrivateKey struct {
79
- Type *KeyType `protobuf:"varint,1,req,enum=crypto.KeyType" json:"Type,omitempty"`
79
+ Type *KeyType `protobuf:"varint,1,req,enum=crypto.pb.KeyType" json:"Type,omitempty"`
80
Data []byte `protobuf:"bytes,2,req" json:"Data,omitempty"`
81
XXX_unrecognized []byte `json:"-"`
82
}
@@ -100,5 +100,5 @@ func (m *PBPrivateKey) GetData() []byte {
100
}
101
102
func init() {
103
- proto.RegisterEnum("crypto.KeyType", KeyType_name, KeyType_value)
103
+ proto.RegisterEnum("crypto.pb.KeyType", KeyType_name, KeyType_value)
104
}
crypto/internal/pb/crypto.proto
renamed
+1
-1
@@ -1,4 +1,4 @@
1
-package crypto;
1
+package crypto.pb;
2
3
enum KeyType {
4
RSA = 0;