Instantiate a new
To configure the client, instantiate a new
myCluster, _ := gocb.Connect("couchbase://10.4.4.1")
To connect to a bucket, call the
OpenBucket() method against your
Cluster instance, passing in the name of the bucket that you want to connect to, along with any password.
If a blank bucket name is specified, the default bucket is opened.
The following example shows how to connect to a bucket:
myBucket, _ := myCluster.OpenBucket("beer-sample", "")
In addition to the bucket name, you can optionally include the bucket password if one has been defined, as shown in the following example:
myBucket, _ := myCluster.OpenBucket("default", "password");