func createElasticClient()

in action/log/logadapter/elasticsearch.go [53:72]


func createElasticClient(currency *Currency) (*elastic.Client, error) {
	httpClient := &http.Client{
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: true,
			},
		},
	}

	client, err := elastic.NewClient(
		elastic.SetURL(currency.Address),
		elastic.SetHttpClient(httpClient),
		elastic.SetSniff(false),
		elastic.SetBasicAuth(currency.Username, currency.Password),
	)
	if err != nil {
		return nil, err
	}
	return client, nil
}