Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add docs examples for topics and use switch to check message type #353

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

anitarua
Copy link
Contributor

@anitarua anitarua commented Sep 12, 2023

Addresses the golang task in #452 by using a switch statement to branch on string vs binary received messages.

Addresses the golang part of #459 by adding code snippets for instantiating a topic client, publishing to a topic, and subscribing to a topic. These examples will be used on this page.

@anitarua anitarua marked this pull request as ready for review September 12, 2023 20:24
@anitarua anitarua requested a review from a team September 12, 2023 20:24
@@ -111,3 +112,62 @@ func example_API_Delete() {
panic(err)
}
}

func example_API_InstantiateTopicClient() {
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we rename this to be MOMENTO_API_KEY?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was wondering if we'd want to make that switch across the SDKs.
I can make a separate PR to rename all the instances to MOMENTO_API_KEY

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@bruuuuuuuce bruuuuuuuce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@anitarua anitarua merged commit 05e3e2e into main Sep 12, 2023
6 checks passed
@anitarua anitarua deleted the topics-docs-examples branch September 12, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants