Work in progress Go wrapper for the Couchbase Cloud REST API
go get github.com/couchbaselabs/couchbase-cloud-go-client
import (
"github.com/couchbaselabs/couchbase-cloud-go-client/couchbasecloud"
)
client := couchbasecloud.NewClient(os.Getenv("CBC_ACCESS_KEY"), os.Getenv("CBC_SECRET_KEY"))
Options can be specified with the ListCloudOptions
type (some are optional)
return client.ListCloudPages(nil, func(clouds couchbasecloud.Clouds, b bool) bool {
for _, cloud := range clouds {
fmt.Println(cloud.Name)
}
})
Options can be specified with the ListClustersOptions
type (some are optional)
return client.ListClusterPages(nil, func(clusters couchbasecloud.Clusters, b bool) bool {
for _, cloud := range clouds {
fmt.Println(cluster.Name)
}
})
- Unit/integration testing
- Add documentation strings to all public types and functions so that documentation can be auto-generated from the code.
- Add linter https://github.com/golangci/golangci-lint to help maintain code quality.
- Auto-generate boilerplate code for the rest of the client using OpenAPI spec for the Couchbase Cloud API. This could also be used to generate a server stub for unit testing or as an emulator for integration level tests.