Skip to content

Commit

Permalink
chore: small refactors; bump openapi plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sudorandom committed Dec 7, 2024
1 parent 2282b3c commit a9d9ebc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/fauxrpc/cmd_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *GenerateCmd) Run(globals *Globals) error {
}
}

desc, err := theRegistry.Files().FindDescriptorByName(protoreflect.FullName(c.Target))
desc, err := theRegistry.FindDescriptorByName(protoreflect.FullName(c.Target))
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/quic-go/quic-go v0.48.2
github.com/rs/cors v1.11.1
github.com/stretchr/testify v1.10.0
github.com/sudorandom/protoc-gen-connect-openapi v0.14.4
github.com/sudorandom/protoc-gen-connect-openapi v0.15.2
github.com/tailscale/hujson v0.0.0-20241010212012-29efb4a0184b
golang.org/x/net v0.31.0
golang.org/x/sync v0.10.0
Expand Down Expand Up @@ -63,6 +63,6 @@ require (
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.27.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241206012308-a4fef0638583 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/sudorandom/protoc-gen-connect-openapi v0.14.4 h1:cH3MlvpmtGApbhQnPvyOL9EkdXIS/syhwhJwbZc7jJs=
github.com/sudorandom/protoc-gen-connect-openapi v0.14.4/go.mod h1:jMVg45oPB6v/Qpl8Dme256cFfvs5jOJMpK5e3tGrGsM=
github.com/sudorandom/protoc-gen-connect-openapi v0.15.2 h1:PhIJq/yakoFC09++Ff2mF+FFqd+TvRf4IiFZxIIMHdU=
github.com/sudorandom/protoc-gen-connect-openapi v0.15.2/go.mod h1:sxLaeknV7LgUZR7lzDi+jU2nLxJfKAqAC/pTi6DSW7w=
github.com/tailscale/hujson v0.0.0-20241010212012-29efb4a0184b h1:MNaGusDfB1qxEsl6iVb33Gbe777IKzPP5PDta0xGC8M=
github.com/tailscale/hujson v0.0.0-20241010212012-29efb4a0184b/go.mod h1:EbW0wDK/qEUYI0A5bqq0C2kF8JTQwWONmGDBbzsxxHo=
github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk=
Expand Down Expand Up @@ -1565,6 +1567,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/api v0.0.0-20241206012308-a4fef0638583 h1:v+j+5gpj0FopU0KKLDGfDo9ZRRpKdi5UBrCP0f76kuY=
google.golang.org/genproto/googleapis/api v0.0.0-20241206012308-a4fef0638583/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
Expand Down
2 changes: 1 addition & 1 deletion private/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *server) rebuildHandlers() error {
}
s.handlerTranscoder.SetHandler(transcoder)
if s.opts.UseReflection {
reflector := grpcreflect.NewReflector(&staticNames{names: serviceNames}, grpcreflect.WithDescriptorResolver(s.ServiceRegistry.Files()))
reflector := grpcreflect.NewReflector(&staticNames{names: serviceNames}, grpcreflect.WithDescriptorResolver(s.ServiceRegistry))
_, v1Handler := grpcreflect.NewHandlerV1(reflector)
s.handlerReflectorV1.SetHandler(v1Handler)

Expand Down
2 changes: 1 addition & 1 deletion private/stubs/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (h *handler) AddStubs(ctx context.Context, req *connect.Request[stubsv1.Add
Priority: int(stub.GetPriority()),
}

desc, err := h.registry.Files().FindDescriptorByName(name)
desc, err := h.registry.FindDescriptorByName(name)
if err != nil {
return nil, fmt.Errorf("unable to find object named %s: %w", name, err)
}
Expand Down

0 comments on commit a9d9ebc

Please sign in to comment.