Go
Latest commit b2479ad Oct 4, 2017 @steveyen steveyen cbdatasource: fix comments & typos
Change-Id: I08cbaf893b0cbf2321b360c8ef16fbd0ed04740a
Reviewed-on: http://review.couchbase.org/84034
Reviewed-by: Marty Schoch <marty.schoch@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
Permalink
Failed to load latest commit information.
cbdatasource cbdatasource: fix comments & typos Oct 9, 2017
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-26265 turn off parallel gets for single document fetches Oct 5, 2017
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-23555 shouldn't try to access ddocs for ephemeral buckets Mar 30, 2017
observe.go MB-19585 Change Bucket to use an RWMutex rather than atomic operations. Sep 26, 2016
pools.go MB-24522 - cfg_cb auth failure when bucketname != username Aug 2, 2017
pools_test.go Some testing on connection pool replacement/fetching Dec 7, 2013
streaming.go MB-21094 Add method to put user roles (for GRANT ROLES statement.) Dec 14, 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-24637 set correct domain for configured administrator Jun 8, 2017
users_test.go MB-23256 create Go API for getting all defined roles Mar 14, 2017
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"})