atlas-sdk

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: Apache-2.0

README

atlas-sdk-go

PkgGoDev CI

A Go SDK for the MongoDB Atlas API.

Note that atlas-sdk-go only supports the two most recent major versions of Go.

Getting started

Adding Dependency
go install go.mongodb.org/atlas-sdk
Using in the code
import "go.mongodb.org/atlas-sdk/admin"

Construct a new Atlas SDK client, then use the various services on the client to access different parts of the Atlas API. For example:

import "go.mongodb.org/atlas-sdk/admin"

apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")

sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
projects, response, err := sdk.ProjectsApi.ListProjects(ctx).Execute()

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

The services of a client divide the API into logical chunks and correspond to the structure of the Atlas API documentation at https://www.mongodb.com/docs/atlas/reference/api-resources-spec/.

Documentation

Please refer to the docs

Examples

See examples

Contributing

See our CONTRIBUTING.md Guide.

License

atlas-sdk-go is released under the Apache 2.0 license. See LICENSE

Directories

Path Synopsis
Package admin supports the MongoDB Atlas Admin API.
Package admin supports the MongoDB Atlas Admin API.
Package auth provides a way to follow a Device Authorization Grant https://datatracker.ietf.org/doc/html/rfc8628.
Package auth provides a way to follow a Device Authorization Grant https://datatracker.ietf.org/doc/html/rfc8628.
internal
core
Package core should not be used by end users.
Package core should not be used by end users.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL