Skip to content

Commit

Permalink
Recommend Go stack client (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anaethelion authored Dec 18, 2024
1 parent 400f8dd commit 56b0117
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions serverless/pages/clients-go-getting-started.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[elasticsearch-go-client-getting-started]]
= Get started with the serverless Go client
= Get started with the Elasticsearch Go client

// :description: Set up and use the Go client for {es3}.
// :description: Set up and use the Go client.
// :keywords: serverless, elasticsearch, go, how to

[NOTE]
Expand All @@ -17,7 +17,7 @@ client for {es3}, shows you how to initialize the client, and how to perform bas
[[elasticsearch-go-client-getting-started-requirements]]
== Requirements

* Go 1.20 or higher installed on your system.
* Go 1.22 or higher installed on your system.

[discrete]
[[elasticsearch-go-client-getting-started-installation]]
Expand All @@ -32,7 +32,7 @@ commands:

[source,bash]
----
go get -u github.com/elastic/elasticsearch-serverless-go@latest
go get -u github.com/elastic/go-elasticsearch/v8@latest
----

[discrete]
Expand All @@ -50,9 +50,9 @@ import (
"log"
"strconv"
"github.com/elastic/elasticsearch-serverless-go"
"github.com/elastic/elasticsearch-serverless-go/typedapi/types"
"github.com/elastic/elasticsearch-serverless-go/typedapi/types/enums/result"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/typedapi/types"
"github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/result"
)
----

Expand All @@ -64,12 +64,12 @@ Initialize the client using your API key and {es} endpoint:

[source,go]
----
client, err := elasticsearch.NewClient(elasticsearch.Config{
APIKey: "you_api_key",
Address: "https://my-project-url",
client, err := elasticsearch.NewTypedClient(elasticsearch.Config{
Addresses: []string{"https://my-project-url"},
APIKey: "your-api-key",
})
if err != nil {
log.Fatal(err)
log.Fatalf("Error creating the client: %s", err)
}
----

Expand Down

0 comments on commit 56b0117

Please sign in to comment.