diff options
-rw-r--r-- | api/grpc_server.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index 7d96a14f..2d194393 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -41,14 +41,17 @@ type Server struct { } func NewGrpcServer(b *server.BgpServer, hosts string) *Server { + return NewServer(b, grpc.NewServer(), hosts) +} + +func NewServer(b *server.BgpServer, g *grpc.Server, hosts string) *Server { grpc.EnableTracing = false - grpcServer := grpc.NewServer() server := &Server{ bgpServer: b, - grpcServer: grpcServer, + grpcServer: g, hosts: hosts, } - RegisterGobgpApiServer(grpcServer, server) + RegisterGobgpApiServer(g, server) return server } |