Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Closes #20.
We're using
go-grpc-middleware
to provide a set of gRPC interceptors fornet.Server
s. We're still usinggo-grpc-middleware/v1
, which is quite old and has caused issues with some downstream applications that usegz-go
.Changes
Most of the changes required to migrate from
v1
tov2
required updating package addresses and minor modification of some interceptors.Interceptors
A number of default interceptors had to be updated because they were deprecated, moved or updated.
grpc_ctxtags
was removed fromgo-grpc-middleware
as a new internal mechanism is now available for different interceptors to communicate. The interceptor was removed from the set of default interceptors.grpc_opentracing
was removed fromgo-grpc-middleware
in favor of OTel implementations. The tracing interceptor package was replaced by thegoogle.golang.org/grpc/otelgrpc
package.go-grpc-middleware
, but no other changes were necessary.Additional changes
grpc_middleware.ChainUnaryServer
was removed fromgo-grpc-middleware
as thegrpc
package introducedgrpc.ChainUnaryInterceptor
to do the same thing.GenerateStreamServerInterceptorsChainWithBase
andGenerateStreamServerInterceptorsChainWithBase
were updated to use the newgrpc
methods. These methods now returnServerOptions
instead of a slice of interceptors.NewServerOptionsGRPC
was updated to call the modified methods directly, as opposed to wrapping them withgrpc.Stream/UnaryInterceptor([...])
since the inner function now returns aServerOption
and no conversion is necessary.go-grpc-middleware/testing
andgo-grpc-middleware/testing/testproto
packages were merged into a singlego-gprc/middleware/v2/testing/testpb
package. All references to these packages were updated.go-grpc-middleware/util/metautils
package was reorganized and is now part of thego-grpc-middleware/metadata
package.