github.com/rhinoman/couchdb-go
Package couchdb provides a simple REST client for CouchDB
Readme
NOTE: Use the v1.0 Tag for CouchDB 1.0. The current master is being used for CouchDB 2.x work (still a work in progress).
This is my golang CouchDB driver. There are many like it, but this one is mine.
go get github.com/rhinoman/couchdb-go
See the Godoc: http://godoc.org/github.com/rhinoman/couchdb-go
Connect to a server and create a new document:
type TestDocument struct {
Title string
Note string
}
...
var timeout = time.Duration(500 * time.Millisecond)
conn, err := couchdb.NewConnection("127.0.0.1",5984,timeout)
auth := couchdb.BasicAuth{Username: "user", Password: "password" }
db := conn.SelectDB("myDatabase", &auth)
theDoc := TestDocument{
Title: "My Document",
Note: "This is a note",
}
theId := genUuid() //use whatever method you like to generate a uuid
//The third argument here would be a revision, if you were updating an existing document
rev, err := db.Save(theDoc, theId, "")
//If all is well, rev should contain the revision of the newly created
//or updated Document
FAQs
Package couchdb provides a simple REST client for CouchDB
We found that github.com/rhinoman/couchdb-go demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.