feat(grpc): Enable reflection

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2024-12-21 20:36:55 +01:00
parent 1ee4788dad
commit 9f9becd38b
3 changed files with 7 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import (
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"cunicu.li/cunicu/pkg/daemon"
"cunicu.li/cunicu/pkg/log"
@@ -44,6 +45,8 @@ func NewServer(d *daemon.Daemon, socket string) (*Server, error) {
s.grpc = grpc.NewServer(grpc.UnaryInterceptor(s.unaryInterceptor))
reflection.Register(s.grpc)
// Register services
s.daemon = NewDaemonServer(s, d)
s.signaling = NewSignalingServer(s, d.Backend)

View File

@@ -15,6 +15,7 @@ import (
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"
"cunicu.li/cunicu/pkg/buildinfo"
"cunicu.li/cunicu/pkg/crypto"
@@ -45,6 +46,7 @@ func NewSignalingServer(opts ...grpc.ServerOption) *Server {
logger: logger,
}
reflection.Register(s)
signalingproto.RegisterSignalingServer(s, s)
return s

View File

@@ -13,6 +13,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/reflection"
"google.golang.org/grpc/status"
"cunicu.li/cunicu/pkg/crypto"
@@ -117,6 +118,7 @@ func NewRelayAPIServer(relays []RelayInfo, opts ...grpc.ServerOption) (*RelayAPI
logger: log.Global.Named("grpc.relay"),
}
reflection.Register(s)
signalingproto.RegisterRelayRegistryServer(s, s)
return s, nil