Go
Latest commit 6575cf1 Aug 8, 2016 @ajres ajres committed with adamcfraser Improve close handling for tap feed (now matches handling in place fo…
…r DCP feed).

Change-Id: If57bd19de4bb4a62a782965ef743a27cf9da738c
Reviewed-on: http://review.couchbase.org/66579
Reviewed-by: Adam Fraser <adam.fraser@couchbase.com>
Tested-by: Adam Fraser <adam.fraser@couchbase.com>
Failed to load latest commit information.
cbdatasource MB-18447 - regularly ping DCP stream when no recent activity Apr 21, 2016
examples bring cb_auth example in sync with latest cbauth development Apr 8, 2016
perf generate proper json documents Sep 10, 2015
platform MB-15554: Copy wrapper for sync/atomic from indexing repo to here Jul 10, 2015
populate CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase. Mar 11, 2015
tools CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase. Mar 11, 2015
trace MB-19040 - cbdatasource trace logging more compact Apr 13, 2016
util CBD-1513: Rename all couchbaselabs Go projects to github.com/couchbase. Mar 11, 2015
.gitignore gitignore vim swap files. Feb 12, 2014
.travis.yml Stupid travis and its old versionness. Jun 28, 2013
LICENSE Added a license Aug 21, 2013
README.markdown GOCBC-19: informs people about the offical Golang SDK Jul 13, 2015
client.go MB-20318. Increase bulk get channel buffer size. Jul 30, 2016
client_test.go Handle WriteOptions masks when stringing Jan 17, 2014
conn_pool.go fix conn pool Close() to pass unit tests Feb 21, 2016
conn_pool_test.go Update import paths for memcached client Apr 14, 2014
ddocs.go MB-17094 Inconsistent timestamps in query.log Feb 11, 2016
observe.go MB-17094 Inconsistent timestamps in query.log Feb 11, 2016
pools.go MB-19388 Check for https before setting tls.Config May 3, 2016
pools_test.go Some testing on connection pool replacement/fetching Dec 7, 2013
streaming.go MB-17094 Inconsistent timestamps in query.log Feb 11, 2016
tap.go Improve close handling for tap feed (now matches handling in place fo… Aug 9, 2016
upr.go MB-17094 Inconsistent timestamps in query.log Feb 11, 2016
util.go doc/golint cleanup Feb 4, 2014
util_test.go Use table for util tests Jan 29, 2014
vbmap.go doc/golint cleanup Feb 4, 2014
vbmap_test.go Atomically perform bucket refreshes Oct 24, 2013
views.go Log details of non-healthy nodes in Bucket.HealthyNodes(). MB-13998. Apr 21, 2015
views_test.go doc/golint cleanup Feb 10, 2014

README.markdown

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])[https://github.com/couchbaselabs/gocb].

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"})