mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-04-28 17:10:14 +08:00
add go_package
option to proto files
This commit is contained in:
parent
d23f421085
commit
5a543a79bd
@ -1,10 +1,17 @@
|
||||
PB = $(wildcard *.proto)
|
||||
GO = $(PB:.proto=.pb.go)
|
||||
|
||||
OUTDIR = ./out
|
||||
|
||||
all: $(GO)
|
||||
|
||||
%.pb.go: %.proto
|
||||
protoc --proto_path=$(GOPATH)/src:. --gogofaster_out=. $<
|
||||
$(OUTDIR):
|
||||
mkdir -p $(OUTDIR)
|
||||
|
||||
%.pb.go: %.proto $(OUTDIR)
|
||||
protoc --proto_path=$(GOPATH)/src:../../..:. --gogofaster_out=$(OUTDIR) $< && \
|
||||
find $(OUTDIR) -name $@ -exec mv '{}' . \; && \
|
||||
rm -rf $(OUTDIR)
|
||||
|
||||
clean:
|
||||
rm -f *.pb.go
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: crypto.proto
|
||||
|
||||
package crypto_pb
|
||||
package pb
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
@ -181,7 +181,7 @@ func init() {
|
||||
func init() { proto.RegisterFile("crypto.proto", fileDescriptor_527278fb02d03321) }
|
||||
|
||||
var fileDescriptor_527278fb02d03321 = []byte{
|
||||
// 203 bytes of a gzipped FileDescriptorProto
|
||||
// 239 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x2e, 0xaa, 0x2c,
|
||||
0x28, 0xc9, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0xf1, 0x92, 0x94, 0x82, 0xb9,
|
||||
0x38, 0x03, 0x4a, 0x93, 0x72, 0x32, 0x93, 0xbd, 0x53, 0x2b, 0x85, 0x74, 0xb8, 0x58, 0x42, 0x2a,
|
||||
@ -192,9 +192,11 @@ var fileDescriptor_527278fb02d03321 = []byte{
|
||||
0xaa, 0x41, 0x88, 0x9d, 0x8b, 0x39, 0x28, 0xd8, 0x51, 0x80, 0x41, 0x88, 0x9b, 0x8b, 0xdd, 0x35,
|
||||
0xc5, 0xc8, 0xd4, 0xd4, 0xd0, 0x52, 0x80, 0x51, 0x88, 0x97, 0x8b, 0x33, 0x38, 0x35, 0xb9, 0xc0,
|
||||
0xc8, 0xd4, 0x2c, 0xdb, 0x50, 0x80, 0x49, 0x88, 0x93, 0x8b, 0xd5, 0xd5, 0xd9, 0x25, 0xd8, 0x51,
|
||||
0x80, 0xd9, 0x49, 0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63,
|
||||
0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x00, 0x01, 0x00,
|
||||
0x00, 0xff, 0xff, 0x13, 0xbe, 0xd4, 0xff, 0x19, 0x01, 0x00, 0x00,
|
||||
0x80, 0xd9, 0xc9, 0xe5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63,
|
||||
0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xb4, 0xd2,
|
||||
0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x73, 0x32, 0x93, 0x0a, 0x8c, 0x0a,
|
||||
0xf4, 0xd3, 0xf3, 0x75, 0x21, 0x2c, 0xdd, 0xe4, 0xfc, 0xa2, 0x54, 0x7d, 0x88, 0x73, 0xf5, 0x0b,
|
||||
0x92, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xd1, 0x49, 0xbf, 0x45, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *PublicKey) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package crypto.pb;
|
||||
option go_package = "github.com/libp2p/go-libp2p-core/crypto/pb";
|
||||
|
||||
enum KeyType {
|
||||
RSA = 0;
|
||||
|
@ -1,10 +1,17 @@
|
||||
PB = $(wildcard *.proto)
|
||||
GO = $(PB:.proto=.pb.go)
|
||||
|
||||
OUTDIR = ./out
|
||||
|
||||
all: $(GO)
|
||||
|
||||
%.pb.go: %.proto
|
||||
protoc --proto_path=$(GOPATH)/src:../../..:. --gogofaster_out=. $<
|
||||
$(OUTDIR):
|
||||
mkdir -p $(OUTDIR)
|
||||
|
||||
%.pb.go: %.proto $(OUTDIR)
|
||||
protoc --proto_path=$(GOPATH)/src:../../..:. --gogofaster_out=$(OUTDIR) $< && \
|
||||
find $(OUTDIR) -name $@ -exec mv '{}' . \; && \
|
||||
rm -rf $(OUTDIR)
|
||||
|
||||
clean:
|
||||
rm -f *.pb.go
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: plaintext.proto
|
||||
|
||||
package plaintext_pb
|
||||
package pb
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
@ -81,7 +81,7 @@ func init() {
|
||||
func init() { proto.RegisterFile("plaintext.proto", fileDescriptor_aba144f73931b711) }
|
||||
|
||||
var fileDescriptor_aba144f73931b711 = []byte{
|
||||
// 159 bytes of a gzipped FileDescriptorProto
|
||||
// 204 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0xc8, 0x49, 0xcc,
|
||||
0xcc, 0x2b, 0x49, 0xad, 0x28, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x41, 0x12, 0x48,
|
||||
0x92, 0x12, 0x4b, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x48, 0xd2, 0x87, 0xb0, 0x20, 0xaa,
|
||||
@ -89,9 +89,12 @@ var fileDescriptor_aba144f73931b711 = []byte{
|
||||
0x32, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x62,
|
||||
0xca, 0x4c, 0x11, 0xd2, 0xe1, 0x62, 0x2b, 0x28, 0x4d, 0xca, 0x4e, 0xad, 0x94, 0x60, 0x52, 0x60,
|
||||
0xd4, 0xe0, 0x36, 0x12, 0xd1, 0x83, 0x19, 0x90, 0xa4, 0x17, 0x50, 0x9a, 0x94, 0x93, 0x99, 0xec,
|
||||
0x9d, 0x5a, 0x19, 0x04, 0x55, 0xe3, 0x24, 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c,
|
||||
0x9d, 0x5a, 0x19, 0x04, 0x55, 0xe3, 0xe4, 0x75, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c,
|
||||
0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72,
|
||||
0x0c, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x97, 0xbc, 0x9e, 0xa1, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x51, 0x06, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x39, 0x99,
|
||||
0x49, 0x05, 0x46, 0x05, 0xfa, 0xe9, 0xf9, 0xba, 0x10, 0x96, 0x6e, 0x72, 0x7e, 0x51, 0xaa, 0x7e,
|
||||
0x71, 0x6a, 0xb2, 0x7e, 0x66, 0x5e, 0x71, 0x6a, 0x72, 0x69, 0x51, 0xaa, 0x7e, 0x41, 0x12, 0x20,
|
||||
0x00, 0x00, 0xff, 0xff, 0x02, 0xef, 0xd6, 0x84, 0xd3, 0x00, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Exchange) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package plaintext.pb;
|
||||
option go_package = "github.com/libp2p/go-libp2p-core/sec/insecure/pb";
|
||||
|
||||
// TODO(yusef): can we add the dir to the include path and avoid relative import?
|
||||
import "crypto/pb/crypto.proto";
|
||||
|
||||
message Exchange {
|
||||
|
Loading…
Reference in New Issue
Block a user