Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master

Adding wrapper for memcached decrement function

Cherry picked from commit #a8c4990457554282d6ea3812edd17e726dde200d

Change-Id: I324e40504e34bb1629d8c6840e6bb894010525fd
Reviewed-by: Manik Taneja <>
Tested-by: Manik Taneja <>
latest commit 3b77a41676
@maniktaneja maniktaneja authored maniktaneja committed
Failed to load latest commit information.
cbdatasource Adding new interface AuthWithSaslHandler
examples Adding wrapper for memcached decrement function
perf generate proper json documents
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 Adding wrapper for memcached decrement function
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.