vendor: update grpc, gogo/protobuf

This commit is contained in:
Gyu-Ho Lee
2016-04-25 14:10:58 -07:00
parent 4b31acf0e0
commit 12d01bb1eb
19 changed files with 384 additions and 241 deletions

View File

@ -8,7 +8,7 @@ import (
// DefaultBackoffConfig uses values specified for backoff in
// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.
var (
DefaultBackoffConfig = &BackoffConfig{
DefaultBackoffConfig = BackoffConfig{
MaxDelay: 120 * time.Second,
baseDelay: 1.0 * time.Second,
factor: 1.6,
@ -33,7 +33,10 @@ type BackoffConfig struct {
// MaxDelay is the upper bound of backoff delay.
MaxDelay time.Duration
// TODO(stevvooe): The following fields are not exported, as allowing changes
// TODO(stevvooe): The following fields are not exported, as allowing
// changes would violate the current GRPC specification for backoff. If
// GRPC decides to allow more interesting backoff strategies, these fields
// may be opened up in the future.
// baseDelay is the amount of time to wait before retrying after the first
// failure.
@ -46,7 +49,16 @@ type BackoffConfig struct {
jitter float64
}
func (bc *BackoffConfig) backoff(retries int) (t time.Duration) {
func setDefaults(bc *BackoffConfig) {
md := bc.MaxDelay
*bc = DefaultBackoffConfig
if md > 0 {
bc.MaxDelay = md
}
}
func (bc BackoffConfig) backoff(retries int) (t time.Duration) {
if retries == 0 {
return bc.baseDelay
}