[VOL-4292] OpenOLT Adapter changes for gRPC migration
Change-Id: I5af2125f2c2f53ffc78c474a94314bba408f8bae
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore
index c198e6a..826caa3 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore
@@ -200,3 +200,5 @@
#vendor
vendor/
+
+.envrc
\ No newline at end of file
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml
index 702fa5b..fc198d8 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml
@@ -1,21 +1,16 @@
sudo: false
language: go
go:
- - 1.8.x
+ - 1.13.x
+ - 1.14.x
+ - 1.15.x
+
env:
- - DEP_VERSION="0.3.2"
-
-before_install:
- # Download the binary to bin folder in $GOPATH
- - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- # Make the binary executable
- - chmod +x $GOPATH/bin/dep
-
-install:
- - dep ensure
+ global:
+ - GO111MODULE=on
script:
- make test
-
+
after_success:
- bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md
index 0e64822..6eeb7e2 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md
@@ -13,10 +13,30 @@
- `Security` in case of vulnerabilities.
## [Unreleased]
-### Added
-- This CHANGELOG file to keep track of changes.
-## 1.0.0 - 2018-05-08
+### Added
+
+- [#223](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/223) Add go-kit logging middleware - [adrien-f](https://github.com/adrien-f)
+
+## [v1.1.0] - 2019-09-12
+### Added
+- [#226](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/226) Support for go modules.
+- [#221](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/221) logging/zap add support for gRPC LoggerV2 - [kush-patel-hs](https://github.com/kush-patel-hs)
+- [#181](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/181) Rate Limit support - [ceshihao](https://github.com/ceshihao)
+- [#161](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/161) Retry on server stream call - [lonnblad](https://github.com/lonnblad)
+- [#152](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/152) Exponential backoff functions - [polyfloyd](https://github.com/polyfloyd)
+- [#147](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/147) Jaeger support for ctxtags extraction - [vporoshok](https://github.com/vporoshok)
+- [#184](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/184) ctxTags identifies if the call was sampled
+
+### Deprecated
+- [#201](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/201) `golang.org/x/net/context` - [houz42](https://github.com/houz42)
+- [#183](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/183) Documentation Generation in favour of <godoc.org>.
+
+### Fixed
+- [172](https://github.com/grpc-ecosystem/go-grpc-middleware/pull/172) Passing ctx into retry and recover - [johanbrandhorst](https://github.com/johanbrandhorst)
+- Numerious documentation fixes.
+
+## v1.0.0 - 2018-05-08
### Added
- grpc_auth
- grpc_ctxtags
@@ -27,4 +47,5 @@
- grpc_validator
- grpc_recovery
-[Unreleased]: https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.0.0...HEAD
+[Unreleased]: https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.1.0...HEAD
+[v1.1.0]: https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.0.0...v1.1.0
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.lock b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.lock
deleted file mode 100644
index ebdcb75..0000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.lock
+++ /dev/null
@@ -1,123 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- name = "cloud.google.com/go"
- packages = ["compute/metadata"]
- revision = "2d3a6656c17a60b0815b7e06ab0be04eacb6e613"
- version = "v0.16.0"
-
-[[projects]]
- name = "github.com/davecgh/go-spew"
- packages = ["spew"]
- revision = "346938d642f2ec3594ed81d874461961cd0faa76"
- version = "v1.1.0"
-
-[[projects]]
- name = "github.com/gogo/protobuf"
- packages = ["gogoproto","proto","protoc-gen-gogo/descriptor"]
- revision = "342cbe0a04158f6dcb03ca0079991a51a4248c02"
- version = "v0.5"
-
-[[projects]]
- branch = "master"
- name = "github.com/golang/protobuf"
- packages = ["jsonpb","proto","ptypes","ptypes/any","ptypes/duration","ptypes/struct","ptypes/timestamp"]
- revision = "1e59b77b52bf8e4b449a57e6f79f21226d571845"
-
-[[projects]]
- name = "github.com/opentracing/opentracing-go"
- packages = [".","ext","log","mocktracer"]
- revision = "1949ddbfd147afd4d964a9f00b24eb291e0e7c38"
- version = "v1.0.2"
-
-[[projects]]
- name = "github.com/pmezard/go-difflib"
- packages = ["difflib"]
- revision = "792786c7400a136282c1664665ae0a8db921c6c2"
- version = "v1.0.0"
-
-[[projects]]
- name = "github.com/sirupsen/logrus"
- packages = ["."]
- revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e"
- version = "v1.0.3"
-
-[[projects]]
- name = "github.com/stretchr/testify"
- packages = ["assert","require","suite"]
- revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0"
- version = "v1.1.4"
-
-[[projects]]
- name = "go.uber.org/atomic"
- packages = ["."]
- revision = "8474b86a5a6f79c443ce4b2992817ff32cf208b8"
- version = "v1.3.1"
-
-[[projects]]
- name = "go.uber.org/multierr"
- packages = ["."]
- revision = "3c4937480c32f4c13a875a1829af76c98ca3d40a"
- version = "v1.1.0"
-
-[[projects]]
- name = "go.uber.org/zap"
- packages = [".","buffer","internal/bufferpool","internal/color","internal/exit","zapcore"]
- revision = "35aad584952c3e7020db7b839f6b102de6271f89"
- version = "v1.7.1"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/crypto"
- packages = ["ssh/terminal"]
- revision = "94eea52f7b742c7cbe0b03b22f0c4c8631ece122"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/net"
- packages = ["context","context/ctxhttp","http2","http2/hpack","idna","internal/timeseries","lex/httplex","trace"]
- revision = "a8b9294777976932365dabb6640cf1468d95c70f"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/oauth2"
- packages = [".","google","internal","jws","jwt"]
- revision = "f95fa95eaa936d9d87489b15d1d18b97c1ba9c28"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/sys"
- packages = ["unix","windows"]
- revision = "13fcbd661c8ececa8807a29b48407d674b1d8ed8"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/text"
- packages = ["collate","collate/build","internal/colltab","internal/gen","internal/tag","internal/triegen","internal/ucd","language","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable"]
- revision = "75cc3cad82b5f47d3fb229ddda8c5167da14f294"
-
-[[projects]]
- name = "google.golang.org/appengine"
- packages = [".","internal","internal/app_identity","internal/base","internal/datastore","internal/log","internal/modules","internal/remote_api","internal/urlfetch","urlfetch"]
- revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a"
- version = "v1.0.0"
-
-[[projects]]
- branch = "master"
- name = "google.golang.org/genproto"
- packages = ["googleapis/rpc/status"]
- revision = "7f0da29060c682909f650ad8ed4e515bd74fa12a"
-
-[[projects]]
- name = "google.golang.org/grpc"
- packages = [".","balancer","balancer/roundrobin","codes","connectivity","credentials","credentials/oauth","encoding","grpclb/grpc_lb_v1/messages","grpclog","internal","keepalive","metadata","naming","peer","resolver","resolver/dns","resolver/passthrough","stats","status","tap","transport"]
- revision = "5a9f7b402fe85096d2e1d0383435ee1876e863d0"
- version = "v1.8.0"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- inputs-digest = "b24c6670412eb0bc44ed1db77fecc52333f8725f3e3272bdc568f5683a63031f"
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.toml b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.toml
deleted file mode 100644
index 0a7d4c1..0000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.toml
+++ /dev/null
@@ -1,35 +0,0 @@
-[[constraint]]
- name = "github.com/gogo/protobuf"
- version = "0.5.0"
-
-[[constraint]]
- branch = "master"
- name = "github.com/golang/protobuf"
-
-[[constraint]]
- name = "github.com/opentracing/opentracing-go"
- version = "1.0.2"
-
-[[constraint]]
- name = "github.com/sirupsen/logrus"
- version = "1.0.3"
-
-[[constraint]]
- name = "github.com/stretchr/testify"
- version = "1.1.4"
-
-[[constraint]]
- name = "go.uber.org/zap"
- version = "1.7.1"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/net"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/oauth2"
-
-[[constraint]]
- name = "google.golang.org/grpc"
- version = "1.8.0"
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md
index 224069b..814e155 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md
@@ -7,7 +7,7 @@
[![codecov](https://codecov.io/gh/grpc-ecosystem/go-grpc-middleware/branch/master/graph/badge.svg)](https://codecov.io/gh/grpc-ecosystem/go-grpc-middleware)
[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![quality: production](https://img.shields.io/badge/quality-production-orange.svg)](#status)
-[![Slack](slack.png)](https://join.slack.com/t/improbable-eng/shared_invite/enQtMzQ1ODcyMzQ5MjM4LWY5ZWZmNGM2ODc5MmViNmQ3ZTA3ZTY3NzQwOTBlMTkzZmIxZTIxODk0OWU3YjZhNWVlNDU3MDlkZGViZjhkMjc)
+[![Slack](https://img.shields.io/badge/slack-%23grpc--middleware-brightgreen)](https://slack.com/share/IRUQCFC23/9Tm7hxRFVKKNoajQfMOcUiIk/enQtODc4ODI4NTIyMDcxLWM5NDA0ZTE4Njg5YjRjYWZkMTI5MzQwNDY3YzBjMzE1YzdjOGM5ZjI1NDNiM2JmNzI2YjM5ODE5OTRiNTEyOWE)
[gRPC Go](https://github.com/grpc/grpc-go) Middleware: interceptors, helpers, utilities.
@@ -15,7 +15,7 @@
[gRPC Go](https://github.com/grpc/grpc-go) recently acquired support for
Interceptors, i.e. [middleware](https://medium.com/@matryer/writing-middleware-in-golang-and-how-go-makes-it-so-much-fun-4375c1246e81#.gv7tdlghs)
-that is executed either on the gRPC Server before the request is passed onto the user's application logic, or on the gRPC client either around the user call. It is a perfect way to implement
+that is executed either on the gRPC Server before the request is passed onto the user's application logic, or on the gRPC client around the user call. It is a perfect way to implement
common patterns: auth, logging, message, validation, retries or monitoring.
These are generic building blocks that make it easy to build multiple microservices easily.
@@ -29,20 +29,20 @@
myServer := grpc.NewServer(
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(
+ grpc_recovery.StreamServerInterceptor(),
grpc_ctxtags.StreamServerInterceptor(),
grpc_opentracing.StreamServerInterceptor(),
grpc_prometheus.StreamServerInterceptor,
grpc_zap.StreamServerInterceptor(zapLogger),
grpc_auth.StreamServerInterceptor(myAuthFunction),
- grpc_recovery.StreamServerInterceptor(),
)),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
+ grpc_recovery.UnaryServerInterceptor(),
grpc_ctxtags.UnaryServerInterceptor(),
grpc_opentracing.UnaryServerInterceptor(),
grpc_prometheus.UnaryServerInterceptor,
grpc_zap.UnaryServerInterceptor(zapLogger),
grpc_auth.UnaryServerInterceptor(myAuthFunction),
- grpc_recovery.UnaryServerInterceptor(),
)),
)
```
@@ -58,7 +58,8 @@
* [`grpc_ctxtags`](tags/) - a library that adds a `Tag` map to context, with data populated from request body
* [`grpc_zap`](logging/zap/) - integration of [zap](https://github.com/uber-go/zap) logging library into gRPC handlers.
* [`grpc_logrus`](logging/logrus/) - integration of [logrus](https://github.com/sirupsen/logrus) logging library into gRPC handlers.
-
+ * [`grpc_kit`](logging/kit/) - integration of [go-kit](https://github.com/go-kit/kit/tree/master/log) logging library into gRPC handlers.
+ * [`grpc_grpc_logsettable`](logging/settable/) - a wrapper around `grpclog.LoggerV2` that allows to replace loggers in runtime (thread-safe).
#### Monitoring
* [`grpc_prometheus`⚡](https://github.com/grpc-ecosystem/go-grpc-prometheus) - Prometheus client-side and server-side monitoring middleware
@@ -71,6 +72,7 @@
#### Server
* [`grpc_validator`](validator/) - codegen inbound message validation from `.proto` options
* [`grpc_recovery`](recovery/) - turn panics into gRPC errors
+ * [`ratelimit`](ratelimit/) - grpc rate limiting by your own limiter
## Status
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go
index 45a2f5f..ea3738b 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go
@@ -6,7 +6,8 @@
package grpc_middleware
import (
- "golang.org/x/net/context"
+ "context"
+
"google.golang.org/grpc"
)
@@ -18,35 +19,19 @@
func ChainUnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor {
n := len(interceptors)
- if n > 1 {
- lastI := n - 1
- return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
- var (
- chainHandler grpc.UnaryHandler
- curI int
- )
-
- chainHandler = func(currentCtx context.Context, currentReq interface{}) (interface{}, error) {
- if curI == lastI {
- return handler(currentCtx, currentReq)
- }
- curI++
- resp, err := interceptors[curI](currentCtx, currentReq, info, chainHandler)
- curI--
- return resp, err
+ return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
+ chainer := func(currentInter grpc.UnaryServerInterceptor, currentHandler grpc.UnaryHandler) grpc.UnaryHandler {
+ return func(currentCtx context.Context, currentReq interface{}) (interface{}, error) {
+ return currentInter(currentCtx, currentReq, info, currentHandler)
}
-
- return interceptors[0](ctx, req, info, chainHandler)
}
- }
- if n == 1 {
- return interceptors[0]
- }
+ chainedHandler := handler
+ for i := n - 1; i >= 0; i-- {
+ chainedHandler = chainer(interceptors[i], chainedHandler)
+ }
- // n == 0; Dummy interceptor maintained for backward compatibility to avoid returning nil.
- return func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
- return handler(ctx, req)
+ return chainedHandler(ctx, req)
}
}
@@ -58,35 +43,19 @@
func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor {
n := len(interceptors)
- if n > 1 {
- lastI := n - 1
- return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
- var (
- chainHandler grpc.StreamHandler
- curI int
- )
-
- chainHandler = func(currentSrv interface{}, currentStream grpc.ServerStream) error {
- if curI == lastI {
- return handler(currentSrv, currentStream)
- }
- curI++
- err := interceptors[curI](currentSrv, currentStream, info, chainHandler)
- curI--
- return err
+ return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
+ chainer := func(currentInter grpc.StreamServerInterceptor, currentHandler grpc.StreamHandler) grpc.StreamHandler {
+ return func(currentSrv interface{}, currentStream grpc.ServerStream) error {
+ return currentInter(currentSrv, currentStream, info, currentHandler)
}
-
- return interceptors[0](srv, stream, info, chainHandler)
}
- }
- if n == 1 {
- return interceptors[0]
- }
+ chainedHandler := handler
+ for i := n - 1; i >= 0; i-- {
+ chainedHandler = chainer(interceptors[i], chainedHandler)
+ }
- // n == 0; Dummy interceptor maintained for backward compatibility to avoid returning nil.
- return func(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
- return handler(srv, stream)
+ return chainedHandler(srv, ss)
}
}
@@ -97,35 +66,19 @@
func ChainUnaryClient(interceptors ...grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor {
n := len(interceptors)
- if n > 1 {
- lastI := n - 1
- return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- var (
- chainHandler grpc.UnaryInvoker
- curI int
- )
-
- chainHandler = func(currentCtx context.Context, currentMethod string, currentReq, currentRepl interface{}, currentConn *grpc.ClientConn, currentOpts ...grpc.CallOption) error {
- if curI == lastI {
- return invoker(currentCtx, currentMethod, currentReq, currentRepl, currentConn, currentOpts...)
- }
- curI++
- err := interceptors[curI](currentCtx, currentMethod, currentReq, currentRepl, currentConn, chainHandler, currentOpts...)
- curI--
- return err
- }
-
- return interceptors[0](ctx, method, req, reply, cc, chainHandler, opts...)
- }
- }
-
- if n == 1 {
- return interceptors[0]
- }
-
- // n == 0; Dummy interceptor maintained for backward compatibility to avoid returning nil.
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- return invoker(ctx, method, req, reply, cc, opts...)
+ chainer := func(currentInter grpc.UnaryClientInterceptor, currentInvoker grpc.UnaryInvoker) grpc.UnaryInvoker {
+ return func(currentCtx context.Context, currentMethod string, currentReq, currentRepl interface{}, currentConn *grpc.ClientConn, currentOpts ...grpc.CallOption) error {
+ return currentInter(currentCtx, currentMethod, currentReq, currentRepl, currentConn, currentInvoker, currentOpts...)
+ }
+ }
+
+ chainedInvoker := invoker
+ for i := n - 1; i >= 0; i-- {
+ chainedInvoker = chainer(interceptors[i], chainedInvoker)
+ }
+
+ return chainedInvoker(ctx, method, req, reply, cc, opts...)
}
}
@@ -136,35 +89,19 @@
func ChainStreamClient(interceptors ...grpc.StreamClientInterceptor) grpc.StreamClientInterceptor {
n := len(interceptors)
- if n > 1 {
- lastI := n - 1
- return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- var (
- chainHandler grpc.Streamer
- curI int
- )
-
- chainHandler = func(currentCtx context.Context, currentDesc *grpc.StreamDesc, currentConn *grpc.ClientConn, currentMethod string, currentOpts ...grpc.CallOption) (grpc.ClientStream, error) {
- if curI == lastI {
- return streamer(currentCtx, currentDesc, currentConn, currentMethod, currentOpts...)
- }
- curI++
- stream, err := interceptors[curI](currentCtx, currentDesc, currentConn, currentMethod, chainHandler, currentOpts...)
- curI--
- return stream, err
- }
-
- return interceptors[0](ctx, desc, cc, method, chainHandler, opts...)
- }
- }
-
- if n == 1 {
- return interceptors[0]
- }
-
- // n == 0; Dummy interceptor maintained for backward compatibility to avoid returning nil.
return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- return streamer(ctx, desc, cc, method, opts...)
+ chainer := func(currentInter grpc.StreamClientInterceptor, currentStreamer grpc.Streamer) grpc.Streamer {
+ return func(currentCtx context.Context, currentDesc *grpc.StreamDesc, currentConn *grpc.ClientConn, currentMethod string, currentOpts ...grpc.CallOption) (grpc.ClientStream, error) {
+ return currentInter(currentCtx, currentDesc, currentConn, currentMethod, currentStreamer, currentOpts...)
+ }
+ }
+
+ chainedStreamer := streamer
+ for i := n - 1; i >= 0; i-- {
+ chainedStreamer = chainer(interceptors[i], chainedStreamer)
+ }
+
+ return chainedStreamer(ctx, desc, cc, method, opts...)
}
}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go
index 7168950..718e100 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go
@@ -23,7 +23,7 @@
myServer := grpc.NewServer(
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(loggingStream, monitoringStream, authStream)),
- grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(loggingUnary, monitoringUnary, authUnary),
+ grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(loggingUnary, monitoringUnary, authUnary)),
)
These interceptors will be executed from left to right: logging, monitoring and auth.
@@ -63,7 +63,7 @@
func FakeAuthStreamingInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
newStream := grpc_middleware.WrapServerStream(stream)
newStream.WrappedContext = context.WithValue(ctx, "user_id", "john@example.com")
- return handler(srv, stream)
+ return handler(srv, newStream)
}
*/
package grpc_middleware
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod
new file mode 100644
index 0000000..7dc62e5
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod
@@ -0,0 +1,22 @@
+module github.com/grpc-ecosystem/go-grpc-middleware
+
+require (
+ github.com/go-kit/kit v0.9.0
+ github.com/go-logfmt/logfmt v0.4.0 // indirect
+ github.com/go-stack/stack v1.8.0 // indirect
+ github.com/gogo/protobuf v1.3.2
+ github.com/golang/protobuf v1.3.3
+ github.com/opentracing/opentracing-go v1.1.0
+ github.com/pkg/errors v0.8.1 // indirect
+ github.com/sirupsen/logrus v1.4.2
+ github.com/stretchr/testify v1.4.0
+ go.uber.org/atomic v1.4.0 // indirect
+ go.uber.org/multierr v1.1.0 // indirect
+ go.uber.org/zap v1.10.0
+ golang.org/x/net v0.0.0-20201021035429-f5854403a974
+ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
+ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215 // indirect
+ google.golang.org/grpc v1.29.1
+)
+
+go 1.14
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum
new file mode 100644
index 0000000..ee522cd
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum
@@ -0,0 +1,122 @@
+cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=
+github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
+github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
+github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
+github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
+github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
+go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
+go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
+go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215 h1:0Uz5jLJQioKgVozXa1gzGbzYxbb/rhQEVvSWxzw5oUs=
+google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4=
+google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile
index 51dc5b8..b18d2d2 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile
@@ -8,7 +8,8 @@
go fmt $(GOFILES_NOVENDOR)
vet:
- go vet $(GOFILES_NOVENDOR)
+ # do not check lostcancel, they are intentional.
+ go vet -lostcancel=false $(GOFILES_NOVENDOR)
test: vet
./scripts/test_all.sh
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{}) {
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/client_interceptors.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/client_interceptors.go
index f8fdecf..2e9cafd 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/client_interceptors.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/client_interceptors.go
@@ -4,6 +4,7 @@
package grpc_opentracing
import (
+ "context"
"io"
"sync"
@@ -11,7 +12,6 @@
opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/opentracing/opentracing-go/log"
- "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
@@ -25,6 +25,9 @@
return invoker(parentCtx, method, req, reply, cc, opts...)
}
newCtx, clientSpan := newClientSpanFromContext(parentCtx, o.tracer, method)
+ if o.unaryRequestHandlerFunc != nil {
+ o.unaryRequestHandlerFunc(clientSpan, req)
+ }
err := invoker(newCtx, method, req, reply, cc, opts...)
finishClientSpan(clientSpan, err)
return err
@@ -76,9 +79,7 @@
func (s *tracedClientStream) CloseSend() error {
err := s.ClientStream.CloseSend()
- if err != nil {
- s.finishClientSpan(err)
- }
+ s.finishClientSpan(err)
return err
}
@@ -127,7 +128,7 @@
// Make sure we add this to the metadata of the call, so it gets propagated:
md := metautils.ExtractOutgoing(ctx).Clone()
if err := tracer.Inject(clientSpan.Context(), opentracing.HTTPHeaders, metadataTextMap(md)); err != nil {
- grpclog.Printf("grpc_opentracing: failed serializing trace information: %v", err)
+ grpclog.Infof("grpc_opentracing: failed serializing trace information: %v", err)
}
ctxWithMetadata := md.ToOutgoing(ctx)
return opentracing.ContextWithSpan(ctxWithMetadata, clientSpan), clientSpan
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/id_extract.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/id_extract.go
index d19f3c8..bc7302e 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/id_extract.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/id_extract.go
@@ -23,8 +23,11 @@
// https://github.com/opentracing/basictracer-go/blob/1b32af207119a14b1b231d451df3ed04a72efebf/propagation_ot.go#L26
// Jaeger from Uber use one-key schema with next format '{trace-id}:{span-id}:{parent-span-id}:{flags}'
// https://www.jaegertracing.io/docs/client-libraries/#trace-span-identity
-func injectOpentracingIdsToTags(span opentracing.Span, tags grpc_ctxtags.Tags) {
- if err := span.Tracer().Inject(span.Context(), opentracing.HTTPHeaders, &tagsCarrier{tags}); err != nil {
+// Datadog uses keys ending with 'trace-id' and 'parent-id' (for span) by default:
+// https://github.com/DataDog/dd-trace-go/blob/v1/ddtrace/tracer/textmap.go#L77
+func injectOpentracingIdsToTags(traceHeaderName string, span opentracing.Span, tags grpc_ctxtags.Tags) {
+ if err := span.Tracer().Inject(span.Context(), opentracing.HTTPHeaders,
+ &tagsCarrier{Tags: tags, traceHeaderName: traceHeaderName}); err != nil {
grpclog.Infof("grpc_opentracing: failed extracting trace info into ctx %v", err)
}
}
@@ -32,10 +35,28 @@
// tagsCarrier is a really hacky way of
type tagsCarrier struct {
grpc_ctxtags.Tags
+ traceHeaderName string
}
func (t *tagsCarrier) Set(key, val string) {
key = strings.ToLower(key)
+
+ if key == t.traceHeaderName {
+ parts := strings.Split(val, ":")
+ if len(parts) == 4 {
+ t.Tags.Set(TagTraceId, parts[0])
+ t.Tags.Set(TagSpanId, parts[1])
+
+ if parts[3] != jaegerNotSampledFlag {
+ t.Tags.Set(TagSampled, "true")
+ } else {
+ t.Tags.Set(TagSampled, "false")
+ }
+
+ return
+ }
+ }
+
if strings.Contains(key, "traceid") {
t.Tags.Set(TagTraceId, val) // this will most likely be base-16 (hex) encoded
}
@@ -51,17 +72,11 @@
}
}
- if key == "uber-trace-id" {
- parts := strings.Split(val, ":")
- if len(parts) == 4 {
- t.Tags.Set(TagTraceId, parts[0])
- t.Tags.Set(TagSpanId, parts[1])
+ if strings.HasSuffix(key, "trace-id") {
+ t.Tags.Set(TagTraceId, val)
+ }
- if parts[3] != jaegerNotSampledFlag {
- t.Tags.Set(TagSampled, "true")
- } else {
- t.Tags.Set(TagSampled, "false")
- }
- }
+ if strings.HasSuffix(key, "parent-id") {
+ t.Tags.Set(TagSpanId, val)
}
}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/metadata.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/metadata.go
index 38f251d..3649fb5 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/metadata.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/metadata.go
@@ -7,8 +7,6 @@
"encoding/base64"
"strings"
- "fmt"
-
"google.golang.org/grpc/metadata"
)
@@ -32,12 +30,8 @@
func (m metadataTextMap) ForeachKey(callback func(key, val string) error) error {
for k, vv := range m {
for _, v := range vv {
- if decodedKey, decodedVal, err := metadata.DecodeKeyValue(k, v); err == nil {
- if err = callback(decodedKey, decodedVal); err != nil {
- return err
- }
- } else {
- return fmt.Errorf("failed decoding opentracing from gRPC metadata: %v", err)
+ if err := callback(k, v); err != nil {
+ return err
}
}
}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/options.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/options.go
index e75102b..430fe56 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/options.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/options.go
@@ -21,9 +21,18 @@
// If it returns false, the given request will not be traced.
type FilterFunc func(ctx context.Context, fullMethodName string) bool
+// UnaryRequestHandlerFunc is a custom request handler
+type UnaryRequestHandlerFunc func(span opentracing.Span, req interface{})
+
+// OpNameFunc is a func that allows custom operation names instead of the gRPC method.
+type OpNameFunc func(method string) string
+
type options struct {
- filterOutFunc FilterFunc
- tracer opentracing.Tracer
+ filterOutFunc FilterFunc
+ tracer opentracing.Tracer
+ traceHeaderName string
+ unaryRequestHandlerFunc UnaryRequestHandlerFunc
+ opNameFunc OpNameFunc
}
func evaluateOptions(opts []Option) *options {
@@ -35,6 +44,9 @@
if optCopy.tracer == nil {
optCopy.tracer = opentracing.GlobalTracer()
}
+ if optCopy.traceHeaderName == "" {
+ optCopy.traceHeaderName = "uber-trace-id"
+ }
return optCopy
}
@@ -47,9 +59,31 @@
}
}
+// WithTraceHeaderName customizes the trace header name where trace metadata passed with requests.
+// Default one is `uber-trace-id`
+func WithTraceHeaderName(name string) Option {
+ return func(o *options) {
+ o.traceHeaderName = name
+ }
+}
+
// WithTracer sets a custom tracer to be used for this middleware, otherwise the opentracing.GlobalTracer is used.
func WithTracer(tracer opentracing.Tracer) Option {
return func(o *options) {
o.tracer = tracer
}
}
+
+// WithUnaryRequestHandlerFunc sets a custom handler for the request
+func WithUnaryRequestHandlerFunc(f UnaryRequestHandlerFunc) Option {
+ return func(o *options) {
+ o.unaryRequestHandlerFunc = f
+ }
+}
+
+// WithOpName customizes the trace Operation name
+func WithOpName(f OpNameFunc) Option {
+ return func(o *options) {
+ o.opNameFunc = f
+ }
+}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/server_interceptors.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/server_interceptors.go
index 53764a0..186b108 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/server_interceptors.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/server_interceptors.go
@@ -4,13 +4,14 @@
package grpc_opentracing
import (
+ "context"
+
"github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/grpc-ecosystem/go-grpc-middleware/tags"
"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/opentracing/opentracing-go/log"
- "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/grpclog"
)
@@ -26,7 +27,14 @@
if o.filterOutFunc != nil && !o.filterOutFunc(ctx, info.FullMethod) {
return handler(ctx, req)
}
- newCtx, serverSpan := newServerSpanFromInbound(ctx, o.tracer, info.FullMethod)
+ opName := info.FullMethod
+ if o.opNameFunc != nil {
+ opName = o.opNameFunc(info.FullMethod)
+ }
+ newCtx, serverSpan := newServerSpanFromInbound(ctx, o.tracer, o.traceHeaderName, opName)
+ if o.unaryRequestHandlerFunc != nil {
+ o.unaryRequestHandlerFunc(serverSpan, req)
+ }
resp, err := handler(newCtx, req)
finishServerSpan(ctx, serverSpan, err)
return resp, err
@@ -40,7 +48,11 @@
if o.filterOutFunc != nil && !o.filterOutFunc(stream.Context(), info.FullMethod) {
return handler(srv, stream)
}
- newCtx, serverSpan := newServerSpanFromInbound(stream.Context(), o.tracer, info.FullMethod)
+ opName := info.FullMethod
+ if o.opNameFunc != nil {
+ opName = o.opNameFunc(info.FullMethod)
+ }
+ newCtx, serverSpan := newServerSpanFromInbound(stream.Context(), o.tracer, o.traceHeaderName, opName)
wrappedStream := grpc_middleware.WrapServerStream(stream)
wrappedStream.WrappedContext = newCtx
err := handler(srv, wrappedStream)
@@ -49,21 +61,21 @@
}
}
-func newServerSpanFromInbound(ctx context.Context, tracer opentracing.Tracer, fullMethodName string) (context.Context, opentracing.Span) {
+func newServerSpanFromInbound(ctx context.Context, tracer opentracing.Tracer, traceHeaderName, opName string) (context.Context, opentracing.Span) {
md := metautils.ExtractIncoming(ctx)
parentSpanContext, err := tracer.Extract(opentracing.HTTPHeaders, metadataTextMap(md))
if err != nil && err != opentracing.ErrSpanContextNotFound {
- grpclog.Printf("grpc_opentracing: failed parsing trace information: %v", err)
+ grpclog.Infof("grpc_opentracing: failed parsing trace information: %v", err)
}
serverSpan := tracer.StartSpan(
- fullMethodName,
+ opName,
// this is magical, it attaches the new span to the parent parentSpanContext, and creates an unparented one if empty.
ext.RPCServerOption(parentSpanContext),
grpcTag,
)
- injectOpentracingIdsToTags(serverSpan, grpc_ctxtags.Extract(ctx))
+ injectOpentracingIdsToTags(traceHeaderName, serverSpan, grpc_ctxtags.Extract(ctx))
return opentracing.ContextWithSpan(ctx, serverSpan), serverSpan
}
@@ -74,7 +86,6 @@
// Don't tag errors, log them instead.
if vErr, ok := v.(error); ok {
serverSpan.LogKV(k, vErr.Error())
-
} else {
serverSpan.SetTag(k, v)
}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/nicemd.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/nicemd.go
index a277bee..1c60585 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/nicemd.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/nicemd.go
@@ -4,9 +4,9 @@
package metautils
import (
+ "context"
"strings"
- "golang.org/x/net/context"
"google.golang.org/grpc/metadata"
)
@@ -49,7 +49,7 @@
found = true
} else {
for _, allowedKey := range copiedKeys {
- if strings.ToLower(allowedKey) == strings.ToLower(k) {
+ if strings.EqualFold(allowedKey, k) {
found = true
break
}
@@ -83,7 +83,7 @@
//
// The function is binary-key safe.
func (m NiceMD) Get(key string) string {
- k, _ := encodeKeyValue(key, "")
+ k := strings.ToLower(key)
vv, ok := m[k]
if !ok {
return ""
@@ -98,7 +98,7 @@
// The function is binary-key safe.
func (m NiceMD) Del(key string) NiceMD {
- k, _ := encodeKeyValue(key, "")
+ k := strings.ToLower(key)
delete(m, k)
return m
}
@@ -109,8 +109,8 @@
//
// The function is binary-key safe.
func (m NiceMD) Set(key string, value string) NiceMD {
- k, v := encodeKeyValue(key, value)
- m[k] = []string{v}
+ k := strings.ToLower(key)
+ m[k] = []string{value}
return m
}
@@ -120,7 +120,7 @@
//
// The function is binary-key safe.
func (m NiceMD) Add(key string, value string) NiceMD {
- k, v := encodeKeyValue(key, value)
- m[k] = append(m[k], v)
+ k := strings.ToLower(key)
+ m[k] = append(m[k], value)
return m
}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/single_key.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/single_key.go
deleted file mode 100644
index 8a53871..0000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/single_key.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package metautils
-
-import (
- "encoding/base64"
- "strings"
-)
-
-const (
- binHdrSuffix = "-bin"
-)
-
-func encodeKeyValue(k, v string) (string, string) {
- k = strings.ToLower(k)
- if strings.HasSuffix(k, binHdrSuffix) {
- val := base64.StdEncoding.EncodeToString([]byte(v))
- v = string(val)
- }
- return k, v
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go
index 597b862..05ccfb3 100644
--- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go
+++ b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go
@@ -4,7 +4,8 @@
package grpc_middleware
import (
- "golang.org/x/net/context"
+ "context"
+
"google.golang.org/grpc"
)