Update etcd client to 3.3.9

This commit is contained in:
Joe Betz
2018-10-01 16:53:57 -07:00
parent 5d0c19c261
commit 4263c75211
432 changed files with 44092 additions and 43584 deletions

View File

@@ -25,7 +25,6 @@ go_library(
"//vendor/github.com/coreos/etcd/pkg/types:go_default_library",
"//vendor/github.com/coreos/etcd/version:go_default_library",
"//vendor/github.com/ugorji/go/codec:go_default_library",
"//vendor/golang.org/x/net/context:go_default_library",
],
)

View File

@@ -25,8 +25,8 @@ package main
import (
"log"
"time"
"context"
"golang.org/x/net/context"
"github.com/coreos/etcd/client"
)

View File

@@ -16,11 +16,10 @@ package client
import (
"bytes"
"context"
"encoding/json"
"net/http"
"net/url"
"golang.org/x/net/context"
)
type Role struct {

View File

@@ -16,12 +16,11 @@ package client
import (
"bytes"
"context"
"encoding/json"
"net/http"
"net/url"
"path"
"golang.org/x/net/context"
)
var (

View File

@@ -15,6 +15,7 @@
package client
import (
"context"
"encoding/json"
"errors"
"fmt"
@@ -29,8 +30,6 @@ import (
"time"
"github.com/coreos/etcd/version"
"golang.org/x/net/context"
)
var (
@@ -671,8 +670,15 @@ func (r *redirectedHTTPAction) HTTPRequest(ep url.URL) *http.Request {
}
func shuffleEndpoints(r *rand.Rand, eps []url.URL) []url.URL {
p := r.Perm(len(eps))
neps := make([]url.URL, len(eps))
// copied from Go 1.9<= rand.Rand.Perm
n := len(eps)
p := make([]int, n)
for i := 0; i < n; i++ {
j := r.Intn(i + 1)
p[i] = p[j]
p[j] = i
}
neps := make([]url.URL, n)
for i, k := range p {
neps[i] = eps[k]
}

View File

@@ -19,9 +19,9 @@ Create a Config and exchange it for a Client:
import (
"net/http"
"context"
"github.com/coreos/etcd/client"
"golang.org/x/net/context"
)
cfg := client.Config{
@@ -59,7 +59,7 @@ Use a custom context to set timeouts on your operations:
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
// set a new key, ignoring it's previous state
// set a new key, ignoring its previous state
_, err := kAPI.Set(ctx, "/ping", "pong", nil)
if err != nil {
if err == context.DeadlineExceeded {

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,7 @@ package client
//go:generate codecgen -d 1819 -r "Node|Response|Nodes" -o keys.generated.go keys.go
import (
"context"
"encoding/json"
"errors"
"fmt"
@@ -28,7 +29,6 @@ import (
"github.com/coreos/etcd/pkg/pathutil"
"github.com/ugorji/go/codec"
"golang.org/x/net/context"
)
const (
@@ -653,8 +653,7 @@ func unmarshalHTTPResponse(code int, header http.Header, body []byte) (res *Resp
default:
err = unmarshalFailedKeysResponse(body)
}
return
return res, err
}
func unmarshalSuccessfulKeysResponse(header http.Header, body []byte) (*Response, error) {

View File

@@ -16,14 +16,13 @@ package client
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"path"
"golang.org/x/net/context"
"github.com/coreos/etcd/pkg/types"
)
@@ -44,7 +43,7 @@ type Member struct {
PeerURLs []string `json:"peerURLs"`
// ClientURLs represents the HTTP(S) endpoints on which this Member
// serves it's client-facing APIs.
// serves its client-facing APIs.
ClientURLs []string `json:"clientURLs"`
}