Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 645 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 645 Bytes

Go SDK examples

Running Examples

For documentation about obtaining apiKey and apiSecret go to https://docs.atlas.mongodb.com/configure-api-access.

export MONGODB_ATLAS_PUBLIC_KEY=somekey 
export MONGODB_ATLAS_PRIVATE_KEY=some-secret-key-for-gosdkapi
go run ./aws_cluster/aws.go

Running Examples with Mocked Backend

SDK provides mocks using Testify and Mockery. One of the SDK examples covers usage of the mockery within tests.

go test ./mock/cluster_test.go 

Examples Reference

Retry Example

Example provides automatic retries for all HTTP 500, 429 HTTP status errors.

go run ./retry/retry.go