提交 6e9e29b8 作者: Brian Tiger Chow

fix(crypto) rename proto package -> crypto_pb, regen go file

+ add Makefile
上级 75a860ca
PB = $(wildcard *.proto)
GO = $(PB:.proto=.pb.go)
all: $(GO)
%.pb.go: %.proto
protoc --gogo_out=. --proto_path=../../../../../../:/usr/local/opt/protobuf/include:. $<
clean:
rm *.pb.go
// Code generated by protoc-gen-go.
// source: encode.proto
// Code generated by protoc-gen-gogo.
// source: crypto.proto
// DO NOT EDIT!
/*
Package crypto is a generated protocol buffer package.
Package crypto_pb is a generated protocol buffer package.
It is generated from these files:
encode.proto
crypto.proto
It has these top-level messages:
PBPublicKey
PBPrivateKey
*/
package crypto
package crypto_pb
import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
......@@ -52,7 +52,7 @@ func (x *KeyType) UnmarshalJSON(data []byte) error {
}
type PBPublicKey struct {
Type *KeyType `protobuf:"varint,1,req,enum=crypto.KeyType" json:"Type,omitempty"`
Type *KeyType `protobuf:"varint,1,req,enum=crypto.pb.KeyType" json:"Type,omitempty"`
Data []byte `protobuf:"bytes,2,req" json:"Data,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
......@@ -76,7 +76,7 @@ func (m *PBPublicKey) GetData() []byte {
}
type PBPrivateKey struct {
Type *KeyType `protobuf:"varint,1,req,enum=crypto.KeyType" json:"Type,omitempty"`
Type *KeyType `protobuf:"varint,1,req,enum=crypto.pb.KeyType" json:"Type,omitempty"`
Data []byte `protobuf:"bytes,2,req" json:"Data,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
......@@ -100,5 +100,5 @@ func (m *PBPrivateKey) GetData() []byte {
}
func init() {
proto.RegisterEnum("crypto.KeyType", KeyType_name, KeyType_value)
proto.RegisterEnum("crypto.pb.KeyType", KeyType_name, KeyType_value)
}
package crypto;
package crypto.pb;
enum KeyType {
RSA = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论