[Vendor] Update directly used dependencys (#15593)

* update github.com/blevesearch/bleve v2.0.2 -> v2.0.3

* github.com/denisenkom/go-mssqldb v0.9.0 -> v0.10.0

* github.com/editorconfig/editorconfig-core-go v2.4.1 -> v2.4.2

* github.com/go-chi/cors v1.1.1 -> v1.2.0

* github.com/go-git/go-billy v5.0.0 -> v5.1.0

* github.com/go-git/go-git v5.2.0 -> v5.3.0

* github.com/go-ldap/ldap v3.2.4 -> v3.3.0

* github.com/go-redis/redis v8.6.0 -> v8.8.2

* github.com/go-sql-driver/mysql v1.5.0 -> v1.6.0

* github.com/go-swagger/go-swagger v0.26.1 -> v0.27.0

* github.com/lib/pq v1.9.0 -> v1.10.1

* github.com/mattn/go-sqlite3 v1.14.6 -> v1.14.7

* github.com/go-testfixtures/testfixtures v3.5.0 -> v3.6.0

* github.com/issue9/identicon v1.0.1 -> v1.2.0

* github.com/klauspost/compress v1.11.8 -> v1.12.1

* github.com/mgechev/revive v1.0.3 -> v1.0.6

* github.com/microcosm-cc/bluemonday v1.0.7 -> v1.0.8

* github.com/niklasfasching/go-org v1.4.0 -> v1.5.0

* github.com/olivere/elastic v7.0.22 -> v7.0.24

* github.com/pelletier/go-toml v1.8.1 -> v1.9.0

* github.com/prometheus/client_golang v1.9.0 -> v1.10.0

* github.com/xanzy/go-gitlab v0.44.0 -> v0.48.0

* github.com/yuin/goldmark v1.3.3 -> v1.3.5

* github.com/6543/go-version v1.2.4 -> v1.3.1

* do github.com/lib/pq v1.10.0 -> v1.10.1 again ...
This commit is contained in:
6543 2021-04-23 02:08:53 +02:00 committed by GitHub
parent 834fc74873
commit 792b4dba2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
558 changed files with 32080 additions and 24669 deletions

View file

@ -14,6 +14,7 @@ import (
"net/http/httputil"
"net/url"
"os"
"runtime"
"strings"
"sync"
"time"
@ -25,7 +26,7 @@ import (
const (
// Version is the current version of Elastic.
Version = "7.0.22"
Version = "7.0.24"
// DefaultURL is the default endpoint of Elasticsearch on the local machine.
// It is used e.g. when initializing a new Client without a specific URL.
@ -983,6 +984,10 @@ func (c *Client) sniffNode(ctx context.Context, url string) []*conn {
}
c.mu.RUnlock()
if req.Header.Get("User-Agent") == "" {
req.Header.Add("User-Agent", "elastic/"+Version+" ("+runtime.GOOS+"-"+runtime.GOARCH+")")
}
res, err := c.c.Do((*http.Request)(req).WithContext(ctx))
if err != nil {
return nodes
@ -1126,6 +1131,9 @@ func (c *Client) healthcheck(parentCtx context.Context, timeout time.Duration, f
}
}
}
if req.Header.Get("User-Agent") == "" {
req.Header.Add("User-Agent", "elastic/"+Version+" ("+runtime.GOOS+"-"+runtime.GOARCH+")")
}
res, err := c.c.Do((*http.Request)(req).WithContext(ctx))
if res != nil {
status = res.StatusCode
@ -1286,6 +1294,7 @@ type PerformRequestOptions struct {
RetryStatusCodes []int
Headers http.Header
MaxResponseSize int64
Stream bool
}
// PerformRequest does a HTTP request to Elasticsearch.
@ -1294,6 +1303,9 @@ type PerformRequestOptions struct {
// Optionally, a list of HTTP error codes to ignore can be passed.
// This is necessary for services that expect e.g. HTTP status 404 as a
// valid outcome (Exists, IndicesExists, IndicesTypeExists).
//
// If Stream is set, the returned BodyReader field must be closed, even
// if PerformRequest returns an error.
func (c *Client) PerformRequest(ctx context.Context, opt PerformRequestOptions) (*Response, error) {
start := time.Now().UTC()
@ -1383,11 +1395,9 @@ func (c *Client) PerformRequest(ctx context.Context, opt PerformRequestOptions)
if opt.ContentType != "" {
req.Header.Set("Content-Type", opt.ContentType)
}
if len(opt.Headers) > 0 {
for key, value := range opt.Headers {
for _, v := range value {
req.Header.Add(key, v)
}
for key, value := range opt.Headers {
for _, v := range value {
req.Header.Add(key, v)
}
}
if len(defaultHeaders) > 0 {
@ -1397,6 +1407,9 @@ func (c *Client) PerformRequest(ctx context.Context, opt PerformRequestOptions)
}
}
}
if req.Header.Get("User-Agent") == "" {
req.Header.Set("User-Agent", "elastic/"+Version+" ("+runtime.GOOS+"-"+runtime.GOARCH+")")
}
// Set body
if opt.Body != nil {
@ -1448,7 +1461,10 @@ func (c *Client) PerformRequest(ctx context.Context, opt PerformRequestOptions)
continue // try again
}
}
defer res.Body.Close()
if !opt.Stream {
defer res.Body.Close()
}
// Tracing
c.dumpResponse(res)
@ -1465,14 +1481,14 @@ func (c *Client) PerformRequest(ctx context.Context, opt PerformRequestOptions)
if err := checkResponse((*http.Request)(req), res, opt.IgnoreErrors...); err != nil {
// No retry if request succeeded
// We still try to return a response.
resp, _ = c.newResponse(res, opt.MaxResponseSize)
resp, _ = c.newResponse(res, opt.MaxResponseSize, opt.Stream)
return resp, err
}
// We successfully made a request with this connection
conn.MarkAsHealthy()
resp, err = c.newResponse(res, opt.MaxResponseSize)
resp, err = c.newResponse(res, opt.MaxResponseSize, opt.Stream)
if err != nil {
return nil, err
}
@ -1620,6 +1636,16 @@ func (c *Client) ClearScroll(scrollIds ...string) *ClearScrollService {
return NewClearScrollService(c).ScrollId(scrollIds...)
}
// OpenPointInTime opens a new Point in Time.
func (c *Client) OpenPointInTime(indices ...string) *OpenPointInTimeService {
return NewOpenPointInTimeService(c).Index(indices...)
}
// ClosePointInTime closes an existing Point in Time.
func (c *Client) ClosePointInTime(id string) *ClosePointInTimeService {
return NewClosePointInTimeService(c).ID(id)
}
// -- Indices APIs --
// CreateIndex returns a service to create a new index.
@ -1835,7 +1861,6 @@ func (c *Client) GetFieldMapping() *IndicesGetFieldMappingService {
// -- cat APIs --
// TODO cat fielddata
// TODO cat master
// TODO cat nodes
// TODO cat pending tasks
@ -1845,6 +1870,11 @@ func (c *Client) GetFieldMapping() *IndicesGetFieldMappingService {
// TODO cat shards
// TODO cat segments
// CatFielddata returns information about the amount of heap memory currently used by the field data cache.
func (c *Client) CatFielddata() *CatFielddataService {
return NewCatFielddataService(c)
}
// CatAliases returns information about aliases.
func (c *Client) CatAliases() *CatAliasesService {
return NewCatAliasesService(c)