Skip to content

Instantly share code, notes, and snippets.

@anujsinghwd
Last active March 23, 2018 06:37
Show Gist options
  • Select an option

  • Save anujsinghwd/947539dc7b578a50a34c4bedea300249 to your computer and use it in GitHub Desktop.

Select an option

Save anujsinghwd/947539dc7b578a50a34c4bedea300249 to your computer and use it in GitHub Desktop.
Connecting couchbase with go
import (
"github.com/couchbase/gocb"
)
var bucket *gocb.Bucket
func main() {
cluster, _ := gocb.Connect("couchbase://localhost")
cluster.Authenticate(gocb.PasswordAuthenticator{
Username: "UserName",
Password: "Password",
})
bucket, _ = cluster.OpenBucket("BucketName", "")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment