Skip to content

d-asmaa/couchbase-cloud-go-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

couchbase-cloud-go-client

Go Reference

Work in progress Go wrapper for the Couchbase Cloud REST API

Usage

go get github.com/couchbaselabs/couchbase-cloud-go-client

Import

import (
    "github.com/couchbaselabs/couchbase-cloud-go-client/couchbasecloud"
)

Client

client := couchbasecloud.NewClient(os.Getenv("CBC_ACCESS_KEY"), os.Getenv("CBC_SECRET_KEY"))

List all clouds

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)
    }
})

List all clusters

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)
    }
})

TODO

  • 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.

About

Go wrapper for the Couchbase Cloud REST API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%