Merge pull request #3192 from thaJeztah/bump_grpc_1.19.1

bump google.golang.org/grpc v1.20.1
This commit is contained in:
Derek McGowan
2019-05-22 11:58:52 -07:00
committed by GitHub
98 changed files with 8186 additions and 5304 deletions

View File

@@ -17,6 +17,7 @@
package dialer
import (
"context"
"net"
"time"
@@ -28,8 +29,19 @@ type dialResult struct {
err error
}
// ContextDialer returns a GRPC net.Conn connected to the provided address
func ContextDialer(ctx context.Context, address string) (net.Conn, error) {
if deadline, ok := ctx.Deadline(); ok {
return timeoutDialer(address, time.Until(deadline))
}
return timeoutDialer(address, 0)
}
// Dialer returns a GRPC net.Conn connected to the provided address
func Dialer(address string, timeout time.Duration) (net.Conn, error) {
// Deprecated: use ContextDialer and grpc.WithContextDialer.
var Dialer = timeoutDialer
func timeoutDialer(address string, timeout time.Duration) (net.Conn, error) {
var (
stopC = make(chan struct{})
synC = make(chan *dialResult)