summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/grpc_server.go
diff options
context:
space:
mode:
authorMarcus Wichelmann <mail@marcusw.de>2021-02-14 22:23:54 +0100
committerMarcus Wichelmann <mail@marcusw.de>2021-03-29 20:53:25 +0200
commitc1e7463e361632de60337cfd52dc44eb453d9746 (patch)
treed3df6e8ed8e99a9e75aca6093f0816c40a57e051 /pkg/server/grpc_server.go
parent7ff15bfa54ac1b0ff7b03ee73e2bee4e7a3d3d73 (diff)
Added ListPeerGroup message to API
Diffstat (limited to 'pkg/server/grpc_server.go')
-rw-r--r--pkg/server/grpc_server.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go
index 2d25734a..1ae58055 100644
--- a/pkg/server/grpc_server.go
+++ b/pkg/server/grpc_server.go
@@ -102,6 +102,18 @@ func (s *server) serve() error {
return nil
}
+func (s *server) ListPeerGroup(r *api.ListPeerGroupRequest, stream api.GobgpApi_ListPeerGroupServer) error {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ fn := func(pg *api.PeerGroup) {
+ if err := stream.Send(&api.ListPeerGroupResponse{PeerGroup: pg}); err != nil {
+ cancel()
+ return
+ }
+ }
+ return s.bgpServer.ListPeerGroup(ctx, r, fn)
+}
+
func parseHost(host string) (string, string) {
const unixScheme = "unix://"
if strings.HasPrefix(host, unixScheme) {