[VOL-4291] Rw-core updates for gRPC migration
Change-Id: I8d5a554409115b29318089671ca4e1ab3fa98810
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/context.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/context.go
index 583025c..0da1658 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/context.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/context.go
@@ -69,10 +69,10 @@
return t
}
-func setInContext(ctx context.Context, tags Tags) context.Context {
+func SetInContext(ctx context.Context, tags Tags) context.Context {
return context.WithValue(ctx, ctxMarkerKey, tags)
}
-func newTags() Tags {
+func NewTags() Tags {
return &mapTags{values: make(map[string]interface{})}
}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/fieldextractor.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/fieldextractor.go
index 549ff48..a4073ab 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/fieldextractor.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/fieldextractor.go
@@ -64,10 +64,10 @@
field := v.Field(i)
kind := field.Kind()
// Only recurse down direct pointers, which should only be to nested structs.
- if kind == reflect.Ptr {
+ if (kind == reflect.Ptr || kind == reflect.Interface) && field.CanInterface() {
reflectMessageTags(field.Interface(), existingMap, tagName)
}
- // In case of arrays/splices (repeated fields) go down to the concrete type.
+ // In case of arrays/slices (repeated fields) go down to the concrete type.
if kind == reflect.Array || kind == reflect.Slice {
if field.Len() == 0 {
continue
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/interceptors.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/interceptors.go
index 038afd2..a7ced60 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/interceptors.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tags/interceptors.go
@@ -4,10 +4,12 @@
package grpc_ctxtags
import (
- "github.com/grpc-ecosystem/go-grpc-middleware"
- "golang.org/x/net/context"
+ "context"
+
"google.golang.org/grpc"
"google.golang.org/grpc/peer"
+
+ "github.com/grpc-ecosystem/go-grpc-middleware"
)
// UnaryServerInterceptor returns a new unary server interceptors that sets the values for request tags.
@@ -66,11 +68,11 @@
}
func newTagsForCtx(ctx context.Context) context.Context {
- t := newTags()
+ t := NewTags()
if peer, ok := peer.FromContext(ctx); ok {
t.Set("peer.address", peer.Addr.String())
}
- return setInContext(ctx, t)
+ return SetInContext(ctx, t)
}
func setRequestFieldTags(ctx context.Context, f RequestFieldExtractorFunc, fullMethodName string, req interface{}) {