-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f3f88e
commit 8026701
Showing
23 changed files
with
450 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_label: Cheat Sheet | ||
sidebar_class_name: sidebar-item-swift | ||
title: Cheat Sheet for Dart | ||
description: Get started really quickly coding using Dart with Momento Cache | ||
--- | ||
|
||
import { SdkExampleCodeBlock } from "@site/src/components/SdkExampleCodeBlock"; | ||
// This import is necessary even though it looks like it's un-used; The inject-example-code-snippet | ||
// plugin will transform instances of SdkExampleCodeBlock to SdkExampleCodeBlockImpl | ||
import { SdkExampleCodeBlockImpl } from "@site/src/components/SdkExampleCodeBlockImpl"; | ||
|
||
# Cheat Sheet for Dart with Momento Cache | ||
|
||
If you need to get going quickly with Dart and Momento Cache, this page contains the basic API calls you'll need. [Check the Dart SDK examples](https://github.com/momentohq/client-sdk-dart/tree/main/examples) for complete, working code samples. | ||
|
||
## Install the Momento SDK | ||
|
||
The latest version of the Momento Dart SDK is available on GitHub: [momentohq/client-sdk-dart](https://github.com/momentohq/client-sdk-dart). | ||
|
||
## Get your Momento API key | ||
|
||
You'll need a Momento API key. You can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
Once you have your token, store it in an environment variable so that the Momento client can consume it: | ||
|
||
``` | ||
export MOMENTO_API_KEY=<your api key here> | ||
``` | ||
|
||
**Note**: it is best practice to put the API key into something like AWS Secret Manager or GCP Secret Manager instead of an environment variable for enhanced security, but we are using one here for demo purposes. | ||
|
||
## Set up a CacheClient | ||
This code creates the CacheClient that you will use to call the other methods. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_InstantiateCacheClient'} /> | ||
|
||
## Create a new cache in Momento Cache | ||
Use this function to create a new cache in your account. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_CreateCache'} /> | ||
|
||
## List the names of existing caches in your account | ||
A simple list of the names of caches for the account. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_ListCaches'} /> | ||
|
||
## Delete a cache | ||
Use this function to delete a cache from your account. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_DeleteCache'} /> | ||
|
||
## Write an item to a cache | ||
A simple example of doing a set operation. In the CacheClient.set() call, the TTL is optional. If you did pass it in, this would override the default TTL value set with the client connection object. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_Set'} /> | ||
|
||
## Read an item from a cache | ||
This is an example of a simple read operation to get an item from a cache. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_Get'} /> | ||
|
||
## Delete an item from a cache | ||
This is an example of deleting an item from a cache. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_Delete'} /> | ||
|
||
## Running the code | ||
|
||
You can find complete, working examples in the [Dart SDK GitHub repo examples directory](https://github.com/momentohq/client-sdk-dart/tree/main/examples). | ||
|
||
:::info | ||
Beyond these basic API calls check out the [API reference page](/cache/develop/api-reference/index.mdx) for more information on the full assortment of Momento API calls. | ||
::: |
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,29 @@ | ||
--- | ||
sidebar_position: 7 | ||
title: Momento Dart SDK | ||
pagination_prev: null | ||
sidebar_label: Dart | ||
description: Information about the Momento Dart SDK | ||
--- | ||
|
||
# Momento Swift SDK | ||
|
||
Welcome to the Momento Dart SDK documentation! | ||
|
||
The Momento Dart SDK and source code are available via GitHub: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-swift). | ||
|
||
## Requirements | ||
|
||
- [Dart version 3](https://dart.dev/get-dart) or higher is required. | ||
- A Momento API key is required; you can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
|
||
## Resources | ||
|
||
- [Dart SDK cheat sheet](./cheat-sheet.mdx) | ||
- [Dart SDK examples](https://github.com/momentohq/client-sdk-dart/tree/main/examples): working example projects that illustrate how to use the Dart SDK | ||
- COMING SOON: Observability: Logging and client-side metrics with the Dart SDK | ||
- COMING SOON: Taking your code to prod: configuration and error handling in the Dart SDK | ||
|
||
## Integrations | ||
|
||
COMING SOON |
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
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,54 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_label: Topics Cheat Sheet | ||
sidebar_class_name: sidebar-item-swift | ||
title: Topics cheat sheet for Swift | ||
description: Get started really quickly coding using Swift with Momento Topics | ||
--- | ||
|
||
import { SdkExampleCodeBlock } from "@site/src/components/SdkExampleCodeBlock"; | ||
// This import is necessary even though it looks like it's un-used; The inject-example-code-snippet | ||
// plugin will transform instances of SdkExampleCodeBlock to SdkExampleCodeBlockImpl | ||
import { SdkExampleCodeBlockImpl } from "@site/src/components/SdkExampleCodeBlockImpl"; | ||
|
||
# Cheat Sheet for Swift with Momento Topics | ||
|
||
If you need to get going quickly with Swift and Momento Topics, this page contains the basic API calls you'll need. [Check the Swift SDK examples](https://github.com/momentohq/client-sdk-swift/tree/main/Examples) for complete, working code samples. | ||
|
||
## Install the Momento SDK | ||
|
||
The latest version of the Momento Swift SDK is available on GitHub: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-swift). | ||
|
||
## Get your Momento API key | ||
|
||
You'll need a Momento API key. You can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
Once you have your token, store it in an environment variable so that the Momento client can consume it: | ||
|
||
``` | ||
export MOMENTO_API_KEY=<your api key here> | ||
``` | ||
|
||
**Note**: it is best practice to put the API key into something like AWS Secret Manager or GCP Secret Manager instead of an environment variable for enhanced security, but we are using one here for demo purposes. | ||
|
||
## Set up a TopicClient | ||
This code creates the TopicClient that you will use to interact with your pub/sub topic. | ||
|
||
<SdkExampleCodeBlock language={'swift'} snippetId={'API_InstantiateTopicClient'} /> | ||
|
||
## Publish a message to a topic | ||
This is an example of publishing a message to a topic called "topic", then catching the return value to check if the publish was successful. | ||
|
||
<SdkExampleCodeBlock language={'swift'} snippetId={'API_TopicPublish'} /> | ||
|
||
## Subscribe to a topic | ||
This is an example of subscribing to a topic called "topic", then catching the return value to check if it was successful. If a subscription was received, a `for try await` loop is used to asynchronously receive and print the messages that are published to this topic. | ||
|
||
<SdkExampleCodeBlock language={'swift'} snippetId={'API_TopicSubscribe'} /> | ||
|
||
## Running the code | ||
|
||
You can find complete, working examples in the [Swift SDK GitHub repo examples directory](https://github.com/momentohq/client-sdk-swift/tree/main/examples). | ||
|
||
:::info | ||
Beyond these basic API calls check out the [API reference page](./../../api-reference) for more information on the full assortment of Momento API calls. | ||
::: |
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,29 @@ | ||
--- | ||
sidebar_position: 7 | ||
title: Momento Topics Dart SDK | ||
pagination_prev: null | ||
sidebar_label: Dart | ||
description: Information about the Momento Dart SDK | ||
--- | ||
|
||
# Momento Topics Dart SDK | ||
|
||
Welcome to the Momento Dart SDK documentation! | ||
|
||
The Momento Dart SDK and source code are available via GitHub: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-dart). | ||
|
||
## Requirements | ||
|
||
- [Dart version 3](https://dart.dev/get-dart) or higher is required. | ||
- A Momento API key is required; you can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
|
||
## Resources | ||
|
||
- [Dart SDK cheat sheet](./cheat-sheet.mdx) | ||
- [Dart SDK examples](https://github.com/momentohq/client-sdk-dart/tree/main/examples): working example projects that illustrate how to use the Dart SDK | ||
- COMING SOON: Observability: Logging and client-side metrics with the Dart SDK | ||
- COMING SOON: Taking your code to prod: configuration and error handling in the Dart SDK | ||
|
||
## Integrations | ||
|
||
COMING SOON |
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
74 changes: 74 additions & 0 deletions
74
.../docusaurus-plugin-content-docs/current/cache/develop/sdks/dart/cheat-sheet.mdx
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,74 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_label: Cheat Sheet | ||
sidebar_class_name: sidebar-item-swift | ||
title: Cheat Sheet for Dart | ||
description: Get started really quickly coding using Dart with Momento Cache | ||
--- | ||
|
||
import { SdkExampleCodeBlock } from "@site/src/components/SdkExampleCodeBlock"; | ||
// This import is necessary even though it looks like it's un-used; The inject-example-code-snippet | ||
// plugin will transform instances of SdkExampleCodeBlock to SdkExampleCodeBlockImpl | ||
import { SdkExampleCodeBlockImpl } from "@site/src/components/SdkExampleCodeBlockImpl"; | ||
|
||
# Cheat Sheet for Dart with Momento Cache | ||
|
||
If you need to get going quickly with Dart and Momento Cache, this page contains the basic API calls you'll need. [Check the Dart SDK examples](https://github.com/momentohq/client-sdk-dart/tree/main/examples) for complete, working code samples. | ||
|
||
## Install the Momento SDK | ||
|
||
The latest version of the Momento Dart SDK is available on GitHub: [momentohq/client-sdk-dart](https://github.com/momentohq/client-sdk-dart). | ||
|
||
## Get your Momento API key | ||
|
||
You'll need a Momento API key. You can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
Once you have your token, store it in an environment variable so that the Momento client can consume it: | ||
|
||
``` | ||
export MOMENTO_API_KEY=<your api key here> | ||
``` | ||
|
||
**Note**: it is best practice to put the API key into something like AWS Secret Manager or GCP Secret Manager instead of an environment variable for enhanced security, but we are using one here for demo purposes. | ||
|
||
## Set up a CacheClient | ||
This code creates the CacheClient that you will use to call the other methods. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_InstantiateCacheClient'} /> | ||
|
||
## Create a new cache in Momento Cache | ||
Use this function to create a new cache in your account. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_CreateCache'} /> | ||
|
||
## List the names of existing caches in your account | ||
A simple list of the names of caches for the account. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_ListCaches'} /> | ||
|
||
## Delete a cache | ||
Use this function to delete a cache from your account. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_DeleteCache'} /> | ||
|
||
## Write an item to a cache | ||
A simple example of doing a set operation. In the CacheClient.set() call, the TTL is optional. If you did pass it in, this would override the default TTL value set with the client connection object. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_Set'} /> | ||
|
||
## Read an item from a cache | ||
This is an example of a simple read operation to get an item from a cache. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_Get'} /> | ||
|
||
## Delete an item from a cache | ||
This is an example of deleting an item from a cache. | ||
|
||
<SdkExampleCodeBlock language={'dart'} snippetId={'API_Delete'} /> | ||
|
||
## Running the code | ||
|
||
You can find complete, working examples in the [Dart SDK GitHub repo examples directory](https://github.com/momentohq/client-sdk-dart/tree/main/examples). | ||
|
||
:::info | ||
Beyond these basic API calls check out the [API reference page](/cache/develop/api-reference/index.mdx) for more information on the full assortment of Momento API calls. | ||
::: |
29 changes: 29 additions & 0 deletions
29
i18n/ja/docusaurus-plugin-content-docs/current/cache/develop/sdks/dart/index.md
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,29 @@ | ||
--- | ||
sidebar_position: 7 | ||
title: Momento Dart SDK | ||
pagination_prev: null | ||
sidebar_label: Dart | ||
description: Information about the Momento Dart SDK | ||
--- | ||
|
||
# Momento Swift SDK | ||
|
||
Welcome to the Momento Dart SDK documentation! | ||
|
||
The Momento Dart SDK and source code are available via GitHub: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-swift). | ||
|
||
## Requirements | ||
|
||
- [Dart version 3](https://dart.dev/get-dart) or higher is required. | ||
- A Momento API key is required; you can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
|
||
## Resources | ||
|
||
- [Dart SDK cheat sheet](./cheat-sheet.mdx) | ||
- [Dart SDK examples](https://github.com/momentohq/client-sdk-dart/tree/main/examples): working example projects that illustrate how to use the Dart SDK | ||
- COMING SOON: Observability: Logging and client-side metrics with the Dart SDK | ||
- COMING SOON: Taking your code to prod: configuration and error handling in the Dart SDK | ||
|
||
## Integrations | ||
|
||
COMING SOON |
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
54 changes: 54 additions & 0 deletions
54
...docusaurus-plugin-content-docs/current/topics/develop/sdks/dart/cheat-sheet.mdx
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,54 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_label: Topics Cheat Sheet | ||
sidebar_class_name: sidebar-item-swift | ||
title: Topics cheat sheet for Swift | ||
description: Get started really quickly coding using Swift with Momento Topics | ||
--- | ||
|
||
import { SdkExampleCodeBlock } from "@site/src/components/SdkExampleCodeBlock"; | ||
// This import is necessary even though it looks like it's un-used; The inject-example-code-snippet | ||
// plugin will transform instances of SdkExampleCodeBlock to SdkExampleCodeBlockImpl | ||
import { SdkExampleCodeBlockImpl } from "@site/src/components/SdkExampleCodeBlockImpl"; | ||
|
||
# Cheat Sheet for Swift with Momento Topics | ||
|
||
If you need to get going quickly with Swift and Momento Topics, this page contains the basic API calls you'll need. [Check the Swift SDK examples](https://github.com/momentohq/client-sdk-swift/tree/main/Examples) for complete, working code samples. | ||
|
||
## Install the Momento SDK | ||
|
||
The latest version of the Momento Swift SDK is available on GitHub: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-swift). | ||
|
||
## Get your Momento API key | ||
|
||
You'll need a Momento API key. You can get one from the [Momento Web Console](https://console.gomomento.com/). | ||
Once you have your token, store it in an environment variable so that the Momento client can consume it: | ||
|
||
``` | ||
export MOMENTO_API_KEY=<your api key here> | ||
``` | ||
|
||
**Note**: it is best practice to put the API key into something like AWS Secret Manager or GCP Secret Manager instead of an environment variable for enhanced security, but we are using one here for demo purposes. | ||
|
||
## Set up a TopicClient | ||
This code creates the TopicClient that you will use to interact with your pub/sub topic. | ||
|
||
<SdkExampleCodeBlock language={'swift'} snippetId={'API_InstantiateTopicClient'} /> | ||
|
||
## Publish a message to a topic | ||
This is an example of publishing a message to a topic called "topic", then catching the return value to check if the publish was successful. | ||
|
||
<SdkExampleCodeBlock language={'swift'} snippetId={'API_TopicPublish'} /> | ||
|
||
## Subscribe to a topic | ||
This is an example of subscribing to a topic called "topic", then catching the return value to check if it was successful. If a subscription was received, a `for try await` loop is used to asynchronously receive and print the messages that are published to this topic. | ||
|
||
<SdkExampleCodeBlock language={'swift'} snippetId={'API_TopicSubscribe'} /> | ||
|
||
## Running the code | ||
|
||
You can find complete, working examples in the [Swift SDK GitHub repo examples directory](https://github.com/momentohq/client-sdk-swift/tree/main/examples). | ||
|
||
:::info | ||
Beyond these basic API calls check out the [API reference page](./../../api-reference) for more information on the full assortment of Momento API calls. | ||
::: |
Oops, something went wrong.