Created
March 3, 2014 15:15
-
-
Save sideshowcoder/9327079 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/couchbaselabs/go-couchbase" | |
"log" | |
) | |
func main() { | |
c, err := couchbase.Connect("http://localhost:8091") | |
if err != nil { | |
log.Fatalf("Error in connect: %v", err) | |
} | |
pool, err := c.GetPool("default") | |
if err != nil { | |
} | |
bucket, err := pool.GetBucket("default") | |
if err != nil { | |
log.Fatalf("Error getting bucket: %v", err) | |
} | |
bucket.SetRaw("foo", 4, []byte("test")) | |
result, err := bucket.GetRaw("foo") | |
fmt.Printf("Value before append: %v \n", string(result)) | |
bucket.Append("foo", []byte(" test")) | |
result2, err := bucket.GetRaw("foo") | |
fmt.Printf("Value after append: %v \n", string(result2)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment