lnrpc/signrpc: add lnrpc.SubServerDriver for signrpc

In this commit, we create a lnrpc.SubServerDriver for signrpc. Note that
this file will only have its init() method executed if the proper build
flag is on. As a result, only if the build flag is set, will the RPC
server be registered, and visible at the packge lnrpc level for the root
server to manipulate.
This commit is contained in:
Olaoluwa Osuntokun
2018-10-22 17:41:14 -07:00
parent b7757683b2
commit 8971931aa3
4 changed files with 15 additions and 14 deletions

View File

@@ -1,24 +1,24 @@
package lnrpc
import (
fmt "fmt"
"fmt"
"sync"
"google.golang.org/grpc"
"gopkg.in/macaroon-bakery.v2/bakery"
)
// MacaroonPerms is a map from the FullMethod of an invoked gRPC command. to
// the set of operations that the macaroon presented with the command MUST
// MacaroonPerms is a map from the FullMethod of an invoked gRPC command. It
// maps the set of operations that the macaroon presented with the command MUST
// satisfy. With this map, all sub-servers are able to communicate to the
// primary macaroon service what type of macaroon must be passed with each
// method present on the service of the sub-server.
type MacaroonPerms map[string][]bakery.Op
// SubServer is a child server of the main lnrpc gRPC server. Sub-servers allow
// lnd to expose discrete services that can be use with or independent of the
// lnd to expose discrete services that can be used with or independent of the
// main RPC server. The main rpcserver will create, start, stop, and manage
// each ubs-server in a generalized manner.
// each sub-server in a generalized manner.
type SubServer interface {
// Start starts the sub-server and all goroutines it needs to operate.
Start() error