lnrpc: add new recursive proto generation script

In this commit, we add a recursive proto generation script. This avoids
having to add a new script for each upcoming sub-server.
This commit is contained in:
Olaoluwa Osuntokun 2018-10-30 21:14:48 -07:00
parent 06d5f2db37
commit 35b4b35eae
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2
4 changed files with 34 additions and 17 deletions

@ -1,5 +1,7 @@
#!/bin/sh
echo "Generating root gRPC server protos"
# Generate the protos.
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
@ -7,8 +9,6 @@ protoc -I/usr/local/include -I. \
--go_out=plugins=grpc:. \
rpc.proto
# Generate the REST reverse proxy.
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
@ -22,3 +22,16 @@ protoc -I/usr/local/include -I. \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--swagger_out=logtostderr=true:. \
rpc.proto
# For each of the sub-servers, we then generate their protos, but a restricted
# set as they don't yet require REST proxies, or swagger docs.
for file in **/*.proto
do
DIRECTORY=$(dirname ${file})
echo "Generating protos from ${file}, into ${DIRECTORY}"
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
--go_out=plugins=grpc:. \
${file}
done

@ -522,7 +522,9 @@ func (m *FeeLimit) String() string { return proto.CompactTextString(m
func (*FeeLimit) ProtoMessage() {}
func (*FeeLimit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
type isFeeLimit_Limit interface{ isFeeLimit_Limit() }
type isFeeLimit_Limit interface {
isFeeLimit_Limit()
}
type FeeLimit_Fixed struct {
Fixed int64 `protobuf:"varint,1,opt,name=fixed,oneof"`
@ -789,7 +791,9 @@ func (m *ChannelPoint) String() string { return proto.CompactTextStri
func (*ChannelPoint) ProtoMessage() {}
func (*ChannelPoint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} }
type isChannelPoint_FundingTxid interface{ isChannelPoint_FundingTxid() }
type isChannelPoint_FundingTxid interface {
isChannelPoint_FundingTxid()
}
type ChannelPoint_FundingTxidBytes struct {
FundingTxidBytes []byte `protobuf:"bytes,1,opt,name=funding_txid_bytes,proto3,oneof"`
@ -2046,7 +2050,9 @@ func (m *CloseStatusUpdate) String() string { return proto.CompactTex
func (*CloseStatusUpdate) ProtoMessage() {}
func (*CloseStatusUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} }
type isCloseStatusUpdate_Update interface{ isCloseStatusUpdate_Update() }
type isCloseStatusUpdate_Update interface {
isCloseStatusUpdate_Update()
}
type CloseStatusUpdate_ClosePending struct {
ClosePending *PendingUpdate `protobuf:"bytes,1,opt,name=close_pending,oneof"`
@ -2327,7 +2333,9 @@ func (m *OpenStatusUpdate) String() string { return proto.CompactText
func (*OpenStatusUpdate) ProtoMessage() {}
func (*OpenStatusUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} }
type isOpenStatusUpdate_Update interface{ isOpenStatusUpdate_Update() }
type isOpenStatusUpdate_Update interface {
isOpenStatusUpdate_Update()
}
type OpenStatusUpdate_ChanPending struct {
ChanPending *PendingUpdate `protobuf:"bytes,1,opt,name=chan_pending,oneof"`
@ -4668,7 +4676,9 @@ func (m *PolicyUpdateRequest) String() string { return proto.CompactT
func (*PolicyUpdateRequest) ProtoMessage() {}
func (*PolicyUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{102} }
type isPolicyUpdateRequest_Scope interface{ isPolicyUpdateRequest_Scope() }
type isPolicyUpdateRequest_Scope interface {
isPolicyUpdateRequest_Scope()
}
type PolicyUpdateRequest_Global struct {
Global bool `protobuf:"varint,1,opt,name=global,oneof"`

@ -1,6 +0,0 @@
#!/bin/sh
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
--go_out=plugins=grpc:. \
signer.proto

@ -1,11 +1,11 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: signer.proto
// source: signrpc/signer.proto
/*
Package signrpc is a generated protocol buffer package.
It is generated from these files:
signer.proto
signrpc/signer.proto
It has these top-level messages:
KeyLocator
@ -441,10 +441,10 @@ var _Signer_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "signer.proto",
Metadata: "signrpc/signer.proto",
}
func init() { proto.RegisterFile("signer.proto", fileDescriptor0) }
func init() { proto.RegisterFile("signrpc/signer.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 465 bytes of a gzipped FileDescriptorProto