-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Adds context selector widget to the getting started page.
- Loading branch information
1 parent
525f3e8
commit e9782d9
Showing
17 changed files
with
524 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
++++ | ||
<div class="tabs" data-tab-group="go-get-started"> | ||
<div role="tablist" aria-label="go-get-started"> | ||
<button role="tab" | ||
aria-selected="true" | ||
aria-controls="low-level-api-tab-connecting" | ||
id="low-level-api-connecting"> | ||
Low-level API | ||
</button> | ||
<button role="tab" | ||
aria-selected="false" | ||
aria-controls="fully-typed-api-tab-connecting" | ||
id="fully-typed-api-connecting"> | ||
Fully-typed API | ||
</button> | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="low-level-api-tab-connecting" | ||
aria-labelledby="low-level-api-connecting"> | ||
++++ | ||
|
||
include::connecting.asciidoc[tag=low-level] | ||
|
||
++++ | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="fully-typed-api-tab-connecting" | ||
aria-labelledby="fully-typed-api-connecting" | ||
hidden=""> | ||
++++ | ||
|
||
include::connecting.asciidoc[tag=fully-typed] | ||
|
||
++++ | ||
</div> | ||
</div> | ||
++++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// tag::low-level[] | ||
|
||
You can connect to the Elastic Cloud using an API key and the Elasticsearch | ||
endpoint for the low level API: | ||
|
||
[source,go] | ||
---- | ||
client, err := elasticsearch.NewClient(elasticsearch.Config{ | ||
CloudID: "<CloudID>", | ||
APIKey: "<ApiKey>", | ||
}) | ||
---- | ||
|
||
// end::low-level[] | ||
|
||
|
||
// tag::fully-typed[] | ||
|
||
You can connect to the Elastic Cloud using an API key and the Elasticsearch | ||
endpoint for the fully-typed API: | ||
|
||
[source,go] | ||
---- | ||
typedClient, err := elasticsearch.NewTypedClient(elasticsearch.Config{ | ||
CloudID: "<CloudID>", | ||
APIKey: "<ApiKey>", | ||
}) | ||
---- | ||
|
||
// end::fully-typed[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
++++ | ||
<div class="tabs" data-tab-group="go-get-started"> | ||
<div role="tablist" aria-label="go-get-started"> | ||
<button role="tab" | ||
aria-selected="true" | ||
aria-controls="low-level-api-tab-create-index" | ||
id="low-level-api-create-index"> | ||
Low-level API | ||
</button> | ||
<button role="tab" | ||
aria-selected="false" | ||
aria-controls="fully-typed-api-tab-create-index" | ||
id="fully-typed-api-create-index"> | ||
Fully-typed API | ||
</button> | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="low-level-api-tab-create-index" | ||
aria-labelledby="low-level-api-create-index"> | ||
++++ | ||
|
||
include::create-index.asciidoc[tag=low-level] | ||
|
||
++++ | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="fully-typed-api-tab-create-index" | ||
aria-labelledby="fully-typed-api-create-index" | ||
hidden=""> | ||
++++ | ||
|
||
include::create-index.asciidoc[tag=fully-typed] | ||
|
||
++++ | ||
</div> | ||
</div> | ||
++++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// tag::low-level[] | ||
|
||
This is how you create the `my_index` index with the low level API: | ||
|
||
[source,go] | ||
---- | ||
client.Indices.Create("my_index") | ||
---- | ||
|
||
// end::low-level[] | ||
|
||
|
||
// tag::fully-typed[] | ||
|
||
This is how you create the `my_index` index with the fully-typed API: | ||
|
||
[source,go] | ||
---- | ||
typedClient.Indices.Create("my_index").Do(context.TODO()) | ||
---- | ||
|
||
// end::fully-typed[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
++++ | ||
<div class="tabs" data-tab-group="go-get-started"> | ||
<div role="tablist" aria-label="go-get-started"> | ||
<button role="tab" | ||
aria-selected="true" | ||
aria-controls="low-level-api-tab-delete-document" | ||
id="low-level-api-delete-document"> | ||
Low-level API | ||
</button> | ||
<button role="tab" | ||
aria-selected="false" | ||
aria-controls="fully-typed-api-tab-delete-document" | ||
id="fully-typed-api-delete-document"> | ||
Fully-typed API | ||
</button> | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="low-level-api-tab-delete-document" | ||
aria-labelledby="low-level-api-delete-document"> | ||
++++ | ||
|
||
include::delete-documents.asciidoc[tag=low-level] | ||
|
||
++++ | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="fully-typed-api-tab-delete-document" | ||
aria-labelledby="fully-typed-api-delete-document" | ||
hidden=""> | ||
++++ | ||
|
||
include::delete-documents.asciidoc[tag=fully-typed] | ||
|
||
++++ | ||
</div> | ||
</div> | ||
++++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// tag::low-level[] | ||
|
||
[source,go] | ||
---- | ||
client.Delete("my_index", "id") | ||
---- | ||
|
||
// end::low-level[] | ||
|
||
|
||
// tag::fully-typed[] | ||
|
||
[source,go] | ||
---- | ||
typedClient.Delete("my_index", "id").Do(context.TODO()) | ||
---- | ||
|
||
// end::fully-typed[] |
Oops, something went wrong.