Skip to content

GODRIVER-2004 Add Versioned API connection examples for docs #665

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

Merged
merged 5 commits into from
May 14, 2021
Merged

GODRIVER-2004 Add Versioned API connection examples for docs #665

merged 5 commits into from
May 14, 2021

Conversation

benjirewis
Copy link
Contributor

GODRIVER-2004

Adds examples of configuring server API options for the docs team.

@benjirewis benjirewis requested review from iwysiu and matthewdale May 11, 2021 19:11
@benjirewis benjirewis requested a review from iwysiu May 11, 2021 21:54
Copy link
Contributor

@iwysiu iwysiu left a comment

Choose a reason for hiding this comment

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

Changes look good, but I just realized: does the pseudocode in the ticket imply that they also want the ApplyURI option to be called? If it does, I think we're allowed to set a string to the uri outside the example blocks and then have a comment mentioning that it's the uri in the example block

@benjirewis
Copy link
Contributor Author

Yeah, good point. It looks like we want to show adding ServerAPIOptions on top of the normal URI, so I used ApplyURI with a URI defined outside of the example blocks.

@benjirewis benjirewis requested a review from iwysiu May 12, 2021 15:17
@benjirewis
Copy link
Contributor Author

Spoke with docs offline: they would like versioned API examples similar to our WithTransactionExample. In particular, explaining the URI used in ApplyURI and showing the definition of the supplied context is important. I've made separate functions for each example, which may seem like overkill, but it will show the full example of creating a client and connecting for each versioned API setup, just as in WithTransactionExample. I've used panics instead of require to mimic what an actual user might do. Note that the examples are still run through examples_test.go with VersionedAPIExamples().

@benjirewis benjirewis requested a review from iwysiu May 12, 2021 18:26
@benjirewis benjirewis requested a review from matthewdale May 14, 2021 13:24
Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@benjirewis benjirewis merged commit 29547bc into mongodb:master May 14, 2021
@benjirewis benjirewis deleted the versionedAPIExamples.2004 branch May 14, 2021 17:43
stlimtat pushed a commit to stlimtat/mongo-go-driver that referenced this pull request May 17, 2021
* 'master' of https://github.com/mongodb/mongo-go-driver: (39 commits)
  GODRIVER-2004 Add Versioned API connection examples for Docs (mongodb#665)
  GODRIVER-1961 Run OCSP tests against RHEL 7.0 (mongodb#664)
  GODRIVER-1844 finer precision for getSecondsSinceEpoch (mongodb#666)
  GODRIVER-1973 create internal copy of aws v4 signing code (mongodb#657)
  GODRIVER-1951 Update the Go version for Evergreen builds to 1.16 (mongodb#663)
  GODRIVER-1949 add more ignored killAllSessions errors for unified tes… (mongodb#658)
  GODRIVER-1963 remove dropDatabase result (mongodb#660)
  GODRIVER-1180 Remove legacy transform functions from mongo (mongodb#583)
  GODRIVER-1937 Update legacy ListCollections to support the BatchSize option for server version 2.6 (mongodb#656)
  GODRIVER-1933 remove xtrace from shell scripts (mongodb#661)
  fix README error handling of FindOne (mongodb#636)
  GODRIVER-1938 update mongocryptd serverSelectionTimeout to 10 seconds (mongodb#659)
  GODRIVER-1925 Surface cursor errors in DownloadStream fillBuffer (mongodb#653)
  GODRIVER-1955 create labeledError interface (mongodb#651)
  GODRIVER-1947 Unmarshal unicode surrogate pairs correctly in UnmarshalExtJSON. (mongodb#649)
  Changed order of actions in ObjectIDFromHex func (mongodb#637)
  GODRIVER-1750 Ensure contexts are always cancelled during server monitoring (mongodb#654)
  GODRIVER-1931 Sync new cursors and SDAM LB tests (mongodb#655)
  GODRIVER-1981 Sync new transactions tests (mongodb#652)
  GODRIVER-1931 Run tests against LBs in Evergreen (mongodb#648)
  ...
faem pushed a commit to kubedb/mongo-go-driver that referenced this pull request Mar 17, 2022
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