Skip to content

Add DataSync example snippets and feature-support entry - #189

Merged
techwritermat merged 2 commits into
feat/data_syncfrom
docs/datasync-example-snippets
Sep 18, 2026
Merged

techwritermat merged 2 commits into
feat/data_syncfrom
docs/datasync-example-snippets

Conversation

@techwritermat

Copy link
Copy Markdown

Summary

  • Adds examples/snippets/api/datasync_example_test.go with the 52 doc-pipeline snippets referenced by the new Go DataSync documentation (create/get/get-all/set/update/remove for users, channels, memberships, entities, and relationships, plus the event listener, projection-channel subscription, and two grant-token examples).
  • Adds setPubnubExampleDataSyncConfigData to config_helper.go, mirroring the existing PAM helper, reading DS_PUBLISH_KEY/DS_SUBSCRIBE_KEY/DS_SECRET_KEY (already present as CI secrets in .github/workflows/run-tests.yml).
  • Registers the data-sync feature group in .pubnub.yml with the 34 DataSync feature keys already defined in the docs repo's registry, so the docs feature-support matrix build doesn't crash for this SDK.

Every example function seeds and cleans up its own running-example data (hidden from the rendered doc snippet via snippet.hide/snippet.show) so it's safe to run individually, repeatedly, or out of order. Every function ends with a deterministic // Output: comment (status codes only, never a dynamically generated id, timestamp, or eTag), which is required for go test to register an Example as a runnable test at all.

Known external dependency

The entity and relationship examples assume the product and ProductOwner classes already exist on the DS_* test keyset via the Admin API — the Go SDK has no method to create classes itself. If those classes aren't provisioned there yet, only those specific examples will fail in CI, independent of this change.

Test plan

  • go build ./... clean
  • go vet ./examples/... clean (only 2 pre-existing unrelated warnings in getting_started.go/onboarding.go)
  • gofmt -l clean on the new/changed files
  • All 52 functions confirmed discoverable via go test ./examples/snippets/api/... -list '.*' (0 before this fix — a first pass omitted // Output: comments, which silently excludes an Example from go test's test list entirely)
  • Real execution against the DS_* keyset (requires CI, not available locally)

🤖 Generated with Claude Code

Adds the doc-pipeline example snippets referenced by the new Go
DataSync documentation, plus the data-sync feature group in
.pubnub.yml so the docs feature-support matrix doesn't crash.

- examples/snippets/api/datasync_example_test.go: 52 Example_* snippets
  covering create/get/get-all/set/update/remove for users, channels,
  memberships, entities, and relationships, plus the DataSync event
  listener, projection channel subscription, and two grant-token
  examples. Every function seeds and cleans up its own running-example
  data (hidden from the rendered snippet via snippet.hide/snippet.show)
  so it is safe to run individually or repeatedly, and every function
  has a deterministic Output comment.
- examples/snippets/api/config_helper.go: adds
  setPubnubExampleDataSyncConfigData, mirroring the existing PAM
  helper, reading DS_PUBLISH_KEY/DS_SUBSCRIBE_KEY/DS_SECRET_KEY.
- .pubnub.yml: registers the data-sync feature group with the 34
  DataSync feature keys already defined in the docs repo's registry.

Note: the entity and relationship examples assume the product and
ProductOwner classes already exist on the DS_* test keyset via the
Admin API. The Go SDK has no method to create classes itself, so if
those classes are missing on that keyset, only those examples will
fail in CI, independent of this change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pubnub-ops-terraform

pubnub-ops-terraform commented Sep 18, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@techwritermat
techwritermat merged commit 8c3c521 into feat/data_sync Sep 18, 2026
8 checks passed
@techwritermat
techwritermat deleted the docs/datasync-example-snippets branch September 18, 2026 11:48
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.

3 participants