From 9b1e87f2b050d9cc091b6c6b78fd50db50498de0 Mon Sep 17 00:00:00 2001 From: Felipe Cavalcanti Date: Fri, 17 Jun 2016 11:30:59 -0300 Subject: [PATCH] update elastic dep, upgrade es_client --- es/es_client.go | 7 +++++++ glide.lock | 20 ++++++++++---------- vendor/github.com/valyala/fasthttp | 2 +- vendor/gopkg.in/topfreegames/elastic.v2 | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/es/es_client.go b/es/es_client.go index 1177dcb..7c2e30f 100644 --- a/es/es_client.go +++ b/es/es_client.go @@ -2,10 +2,12 @@ package es import ( "fmt" + "net/http" "os" "strings" "sync" + "github.com/aws/aws-sdk-go/aws/defaults" "github.com/spf13/viper" "github.com/topfreegames/mqttbot/logger" "gopkg.in/topfreegames/elastic.v2" @@ -34,7 +36,12 @@ func setConfigurationDefaults() { func configureESClient() { logger.Logger.Debug(fmt.Sprintf("Connecting to elasticsearch @ %s", viper.GetString("elasticsearch.host"))) + credentials := defaults.CredChain(defaults.Config(), defaults.Handlers()) + awsSigningRoundTripper := elastic.NewAWSSigningRoundTripper(nil, "us-east-1", credentials) + esHttpClient := &http.Client{Transport: awsSigningRoundTripper} + client, err := elastic.NewClient( + elastic.SetHttpClient(esHttpClient), elastic.SetURL(viper.GetString("elasticsearch.host")), elastic.SetSniff(viper.GetBool("elasticsearch.sniff")), ) diff --git a/glide.lock b/glide.lock index aae4c8c..8104311 100644 --- a/glide.lock +++ b/glide.lock @@ -1,23 +1,23 @@ hash: c44684f22d12202ce19e092857f76bea75d2714c8c342417b8c72911a8b94fb2 -updated: 2016-06-17T01:39:54.412932269-03:00 +updated: 2016-06-17T11:26:29.187399029-03:00 imports: - name: github.com/aws/aws-sdk-go version: d3b6d25135b4e09ecd39ea3c2a5cad35279b0515 subpackages: - - aws - aws/defaults - - aws/request - - private/signer/v4 - - aws/awserr - - aws/credentials + - aws - aws/corehandlers + - aws/credentials - aws/credentials/ec2rolecreds - aws/ec2metadata + - aws/request - private/endpoints - - aws/awsutil + - private/signer/v4 + - aws/awserr + - aws/client - aws/client/metadata + - aws/awsutil - private/protocol/rest - - aws/client - name: github.com/BurntSushi/toml version: f0aeabca5a127c4078abb8c8d64298b147264b55 - name: github.com/cjoudrey/gluahttp @@ -129,7 +129,7 @@ imports: - name: github.com/spf13/viper version: c1ccc378a054ea8d4e38d8c67f6938d4760b53dd - name: github.com/valyala/fasthttp - version: 83a24c301bb683e450cd0304a3eb69556c48678c + version: d42167fd04f636e20b005e9934159e95454233c7 subpackages: - fasthttpadaptor - fasthttputil @@ -154,7 +154,7 @@ imports: subpackages: - unix - name: gopkg.in/topfreegames/elastic.v2 - version: 0996752452c036d9707a8b45308aa28449a21bfa + version: c818f8aa1974340ee8bbfdda4adaf7e832c46353 subpackages: - backoff - uritemplates diff --git a/vendor/github.com/valyala/fasthttp b/vendor/github.com/valyala/fasthttp index 83a24c3..d42167f 160000 --- a/vendor/github.com/valyala/fasthttp +++ b/vendor/github.com/valyala/fasthttp @@ -1 +1 @@ -Subproject commit 83a24c301bb683e450cd0304a3eb69556c48678c +Subproject commit d42167fd04f636e20b005e9934159e95454233c7 diff --git a/vendor/gopkg.in/topfreegames/elastic.v2 b/vendor/gopkg.in/topfreegames/elastic.v2 index 0996752..c818f8a 160000 --- a/vendor/gopkg.in/topfreegames/elastic.v2 +++ b/vendor/gopkg.in/topfreegames/elastic.v2 @@ -1 +1 @@ -Subproject commit 0996752452c036d9707a8b45308aa28449a21bfa +Subproject commit c818f8aa1974340ee8bbfdda4adaf7e832c46353