1# A smart client for couchbase in go
2
3This is a *unoffical* version of a Couchbase Golang client. If you are
4looking for the *Offical* Couchbase Golang client please see
5    [CB-go])[https://github.com/couchbaselabs/gocb].
6
7This is an evolving package, but does provide a useful interface to a
8[couchbase](http://www.couchbase.com/) server including all of the
9pool/bucket discovery features, compatible key distribution with other
10clients, and vbucket motion awareness so application can continue to
11operate during rebalances.
12
13It also supports view querying with source node randomization so you
14don't bang on all one node to do all the work.
15
16## Install
17
18    go get github.com/couchbase/go-couchbase
19
20## Example
21
22    c, err := couchbase.Connect("http://dev-couchbase.example.com:8091/")
23    if err != nil {
24    	log.Fatalf("Error connecting:  %v", err)
25    }
26
27    pool, err := c.GetPool("default")
28    if err != nil {
29    	log.Fatalf("Error getting pool:  %v", err)
30    }
31
32    bucket, err := pool.GetBucket("default")
33    if err != nil {
34    	log.Fatalf("Error getting bucket:  %v", err)
35    }
36
37    bucket.Set("someKey", 0, []string{"an", "example", "list"})
38