Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Go
branch: master

MB-14986: Increase connection pool size and provide API to change it on

the fly
CBSE-1762: Provide API to enable TCP Keepalive on memcached connections

Change-Id: I8d9ea0d347fc3da7f80631fddeff3d40b433e4dd
Reviewed-on: http://review.couchbase.org/51043
Reviewed-by: Manik Taneja <manik@couchbase.com>
Tested-by: Manik Taneja <manik@couchbase.com>
latest commit e0dd367053
@maniktaneja maniktaneja authored maniktaneja committed
Failed to load latest commit information.
cbdatasource cbdatasource fix send on closed channel
examples MB-14986: Increase connection pool size and provide API to change it on
populate CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase.
tools CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase.
util CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase.
.gitignore gitignore vim swap files.
.travis.yml Stupid travis and its old versionness.
LICENSE Added a license
README.markdown CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase.
client.go MB-14255: Avoid race condition between Refresh() and pool.Return
client_test.go Handle WriteOptions masks when stringing
conn_pool.go MB-14986: Increase connection pool size and provide API to change it on
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 MB-14986: Increase connection pool size and provide API to change it on
pools_test.go Some testing on connection pool replacement/fetching
streaming.go Implement bucket streaming API for getting configuration updates
tap.go Refresh bucket on connection error
upr.go MB-14917. Close feed if bucket refresh fails
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

README.markdown

A smart client for couchbase in 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.

Install

go get github.com/couchbase/go-couchbase

Example

c, err := couchbase.Connect("http://dev-couchbase.example.com:8091/")
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.