Go
Latest commit 276a412 Oct 18, 2016 @ysui6888 ysui6888 committed with Yu Sui MB-21194 replace timeSynchronization bucket metadata with conflictRes…
…olutionType

Change-Id: I93383a915a5c571958339ef48f796f3c4bc11221
Reviewed-on: http://review.couchbase.org/68820
Reviewed-by: John Liang <johliang00@yahoo.com>
Reviewed-by: Yu Sui <ysui68@gmail.com>
Tested-by: Yu Sui <ysui68@gmail.com>
Reviewed-on: http://review.couchbase.org/68843
Permalink
Failed to load latest commit information.
cbdatasource MB-20841 - cbdatasource: more checking of vbucketmap int indexes Sep 8, 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-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
observe.go MB-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
pools.go MB-21194 replace timeSynchronization bucket metadata with conflictRes… Oct 17, 2016
pools_test.go Some testing on connection pool replacement/fetching Dec 7, 2013
streaming.go MB-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
tap.go MB-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
upr.go MB-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
users.go MB-21048 Add UserRoles() method. Oct 5, 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 MB-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
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"})