Skip to content
Go
Find file
Latest commit ad5811b @ebenhaber ebenhaber Enhance Buckets with GetRandomDoc() method to get a random doc from t…
…he bucket.

Change-Id: I07c58a04de1125352b5703d9e751bb569461095a
Reviewed-on: http://review.couchbase.org/59674
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Eben Haber <eben@couchbase.com>
Tested-by: Eben Haber <eben@couchbase.com>
Failed to load latest commit information.
cbdatasource Auth cleanup
examples Implement APIs for observe/persist which are needed for enhanced
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 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 GOCBC-19: informs people about the offical Golang SDK
client.go MB-17094 Inconsistent timestamps in query.log
client_test.go Handle WriteOptions masks when stringing
conn_pool.go MB-17094 Inconsistent timestamps in query.log
conn_pool_test.go Update import paths for memcached client
ddocs.go MB-17094 Inconsistent timestamps in query.log
observe.go MB-17094 Inconsistent timestamps in query.log
pools.go Enhance Buckets with GetRandomDoc() method to get a random doc from t…
pools_test.go Some testing on connection pool replacement/fetching
streaming.go MB-17094 Inconsistent timestamps in query.log
tap.go MB-17094 Inconsistent timestamps in query.log
upr.go MB-17094 Inconsistent timestamps in query.log
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 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"})
Something went wrong with that request. Please try again.