TP-5555 | elastic fix (#30)
* TP-5555 | elastic fix * TP-5555 | elastic fix --------- Co-authored-by: varnit goyal <github.cicd@navi.com>
This commit is contained in:
@@ -68,7 +68,7 @@ DocumentService:
|
||||
generate_token: DOCUMENT_SERVICE_MOCK_GENERATE_TOKEN
|
||||
|
||||
elastic:
|
||||
addresses: ELASTIC_ADDRESS
|
||||
addresses: ELASTIC_ADDRESSES
|
||||
username: ELASTIC_USERNAME
|
||||
password: ELASTIC_PASSWORD
|
||||
index: ELASTIC_INDEX
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/tls"
|
||||
"cybertron/configs"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
elasticsearch8 "github.com/elastic/go-elasticsearch/v8"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -17,9 +18,12 @@ type ElasticSearchClient struct {
|
||||
}
|
||||
|
||||
func NewElasticClient(elasticConfig configs.ElasticConfig) (*ElasticSearchClient, error) {
|
||||
fmt.Println("elastic address %v", elasticConfig.Addresses)
|
||||
fmt.Println("elastic address %v", elasticConfig.Username)
|
||||
cfg := elasticsearch8.Config{
|
||||
Addresses: elasticConfig.Addresses,
|
||||
APIKey: elasticConfig.APIKey,
|
||||
Username: elasticConfig.Username,
|
||||
Password: elasticConfig.Password,
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
|
||||
Reference in New Issue
Block a user