Skip to content

Commit 4efcb82

Browse files
committed
[opendistro destination] Reuse same helpers as resource.
1 parent 0525dd9 commit 4efcb82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

es/data_source_elasticsearch_opendistro_destination.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ func dataSourceElasticsearchOpenDistroDestinationRead(d *schema.ResourceData, m
5959
}
6060
switch client := esClient.(type) {
6161
case *elastic7.Client:
62-
id, body, err = elastic7Search(client, DESTINATION_INDEX, destinationName)
62+
id, body, err = destinationElasticsearch7Search(client, DESTINATION_INDEX, destinationName)
6363
case *elastic6.Client:
64-
id, body, err = elastic6Search(client, DESTINATION_INDEX, destinationName)
64+
id, body, err = destinationElasticsearch6Search(client, DESTINATION_INDEX, destinationName)
6565
default:
6666
err = errors.New("destination resource not implemented prior to Elastic v6")
6767
}
@@ -93,7 +93,7 @@ func dataSourceElasticsearchOpenDistroDestinationRead(d *schema.ResourceData, m
9393
return err
9494
}
9595

96-
func elastic7Search(client *elastic7.Client, index string, name string) (string, *json.RawMessage, error) {
96+
func destinationElasticsearch7Search(client *elastic7.Client, index string, name string) (string, *json.RawMessage, error) {
9797
termQuery := elastic7.NewTermQuery(DESTINATION_NAME_FIELD, name)
9898
result, err := client.Search().
9999
Index(index).
@@ -112,7 +112,7 @@ func elastic7Search(client *elastic7.Client, index string, name string) (string,
112112
}
113113
}
114114

115-
func elastic6Search(client *elastic6.Client, index string, name string) (string, *json.RawMessage, error) {
115+
func destinationElasticsearch6Search(client *elastic6.Client, index string, name string) (string, *json.RawMessage, error) {
116116
termQuery := elastic6.NewTermQuery(DESTINATION_NAME_FIELD, name)
117117
result, err := client.Search().
118118
Index(index).

0 commit comments

Comments
 (0)