vendor protobuf & grpc

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2020-02-25 14:27:11 +09:00
parent 9b4967bd6b
commit 8e448bb279
158 changed files with 12967 additions and 10634 deletions

View File

@@ -32,6 +32,7 @@ import (
"github.com/pkg/errors"
"github.com/urfave/cli"
"google.golang.org/grpc"
"google.golang.org/grpc/backoff"
)
var publishCommand = cli.Command{
@@ -92,12 +93,17 @@ func connectEvents(address string) (eventsapi.EventsClient, error) {
}
func connect(address string, d func(gocontext.Context, string) (net.Conn, error)) (*grpc.ClientConn, error) {
backoffConfig := backoff.DefaultConfig
backoffConfig.MaxDelay = 3 * time.Second
connParams := grpc.ConnectParams{
Backoff: backoffConfig,
}
gopts := []grpc.DialOption{
grpc.WithBlock(),
grpc.WithInsecure(),
grpc.WithContextDialer(d),
grpc.FailOnNonTempDialError(true),
grpc.WithBackoffMaxDelay(3 * time.Second),
grpc.WithConnectParams(connParams),
}
ctx, cancel := gocontext.WithTimeout(gocontext.Background(), 2*time.Second)
defer cancel()