Skip to content

Commit

Permalink
don't use now-deleted srcinforeflection package (#172)
Browse files Browse the repository at this point in the history
different way to do it w/ v1.12.0 of protoreflect+latest grpc
  • Loading branch information
jhump authored Feb 20, 2022
1 parent a5287db commit cca8f59
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ go 1.15
require (
github.com/fullstorydev/grpcurl v1.8.6
github.com/golang/protobuf v1.5.2
github.com/jhump/protoreflect v1.11.1-0.20220215191356-c1d18a52a21d
github.com/jhump/protoreflect v1.12.0
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/net v0.0.0-20200822124328-c89045814202
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
google.golang.org/grpc v1.44.0
google.golang.org/grpc v1.45.0-dev.0.20220218222403-011544f72939
google.golang.org/protobuf v1.26.0
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ github.com/jhump/protoreflect v1.10.3/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd
github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E=
github.com/jhump/protoreflect v1.11.1-0.20220215191356-c1d18a52a21d h1:FMo9dFXmLokRC5YLCmlkBbbcLiBROSd/HE6ZoY2hTzw=
github.com/jhump/protoreflect v1.11.1-0.20220215191356-c1d18a52a21d/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI=
github.com/jhump/protoreflect v1.12.0 h1:1NQ4FpWMgn3by/n1X0fbeKEUxP1wBt7+Oitpv01HR10=
github.com/jhump/protoreflect v1.12.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
Expand Down Expand Up @@ -334,6 +336,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0-dev.0.20220218222403-011544f72939 h1:ym8Fun77y7+lr5S6IlK6a+u1I198oJPh4meKIrwd9PA=
google.golang.org/grpc v1.45.0-dev.0.20220218222403-011544f72939/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
11 changes: 9 additions & 2 deletions testing/cmd/testsvr/testsvr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import (
"os"
"strings"

"github.com/jhump/protoreflect/desc/sourceinfo/srcinforeflection"
"github.com/jhump/protoreflect/desc/sourceinfo"
spb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/reflection"
reflectionpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
Expand Down Expand Up @@ -47,7 +49,12 @@ func main() {

svr := grpc.NewServer()
RegisterKitchenSinkServer(svr, &testSvr{})
srcinforeflection.Register(svr)
refSvc := reflection.NewServer(reflection.ServerOptions{
Services: svr,
DescriptorResolver: sourceinfo.GlobalFiles,
ExtensionResolver: sourceinfo.GlobalFiles,
})
reflectionpb.RegisterServerReflectionServer(svr, refSvc)
if err := svr.Serve(l); err != nil {
fmt.Fprintf(os.Stderr, "Failed to start gRPC server: %v\n", err)
os.Exit(1)
Expand Down

0 comments on commit cca8f59

Please sign in to comment.