Skip to content

Commit

Permalink
update elastic dep, upgrade es_client
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Jun 17, 2016
1 parent ed19148 commit 9b1e87f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions es/es_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")),
)
Expand Down
20 changes: 10 additions & 10 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/valyala/fasthttp
Submodule fasthttp updated from 83a24c to d42167
2 changes: 1 addition & 1 deletion vendor/gopkg.in/topfreegames/elastic.v2
Submodule elastic.v2 updated from 099675 to c818f8

0 comments on commit 9b1e87f

Please sign in to comment.