Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master

Adding new interface AuthWithSaslHandler

It is required to pass the auth for memcached with http auth.
So added a new interface couchbase.AuthWithSaslHandler.

Change-Id: Id8541e0a1b8559c5c141e595bb629e4f66e964c5
Reviewed-by: Steve Yen <>
Reviewed-by: Manik Taneja <>
Tested-by: Steve Yen <>
latest commit 89d88b58c1
@nimishzynga nimishzynga authored steveyen committed
Failed to load latest commit information.
cbdatasource Adding new interface AuthWithSaslHandler
examples Adds GetAndTouchRaw API
perf fix starting count in create document mode
platform MB-15554: Copy wrapper for sync/atomic from indexing repo to here
populate CBD-1513: Rename all couchbaselabs Go projects to
tools CBD-1513: Rename all couchbaselabs Go projects to
util CBD-1513: Rename all couchbaselabs Go projects to
.gitignore gitignore vim swap files.
.travis.yml Stupid travis and its old versionness.
LICENSE Added a license
README.markdown GOCBC-19: informs people about the offical Golang SDK
client.go Adds GetAndTouchRaw API
client_test.go Handle WriteOptions masks when stringing
conn_pool.go Avoid crash while setting keepalive if the connection to the server
conn_pool_test.go Update import paths for memcached client
ddocs.go MB-13738 & MB-13878 : Retry http requests due to network failure
pools.go Adding new interface AuthWithSaslHandler
pools_test.go Some testing on connection pool replacement/fetching
streaming.go MB-15153 & MB-15738. Temporarily Backing out the change that added the
tap.go Refresh bucket on connection error
upr.go MB-15208 go-couchbase Bucket.StartUprFeed should allow consumer to co…
util.go doc/golint cleanup
util_test.go Use table for util tests
vbmap.go doc/golint cleanup
vbmap_test.go Atomically perform bucket refreshes
views.go Log details of non-healthy nodes in Bucket.HealthyNodes(). MB-13998.
views_test.go doc/golint cleanup


A smart client for couchbase in go

This is a unoffical version of a Couchbase Golang client. If you are looking for the Offical Couchbase Golang client please see [CB-go])[].

This is an evolving package, but does provide a useful interface to a couchbase server including all of the pool/bucket discovery features, compatible key distribution with other clients, and vbucket motion awareness so application can continue to operate during rebalances.

It also supports view querying with source node randomization so you don't bang on all one node to do all the work.


go get


c, err := couchbase.Connect("")
if err != nil {
    log.Fatalf("Error connecting:  %v", err)

pool, err := c.GetPool("default")
if err != nil {
    log.Fatalf("Error getting pool:  %v", err)

bucket, err := pool.GetBucket("default")
if err != nil {
    log.Fatalf("Error getting bucket:  %v", err)

bucket.Set("someKey", 0, []string{"an", "example", "list"})
Something went wrong with that request. Please try again.