Categorygithub.com/rhinoman/couchdb-go
modulepackage
0.0.0-20180321180027-310a5a9beb66
Repository: https://github.com/rhinoman/couchdb-go.git
Documentation: pkg.go.dev

# README

couchdb-go

Build Status

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).

Description

This is my golang CouchDB driver. There are many like it, but this one is mine.

Installation

go get github.com/rhinoman/couchdb-go

Documentation

See the Godoc: http://godoc.org/github.com/rhinoman/couchdb-go

Example Usage

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

# Functions

Creates a regular http connection.Timeout sets the timeout for the http Client.
Creates an https connection.Timeout sets the timeout for the http Client.

# Structs

No description provided by the author
No description provided by the author
HTTP Basic Authentication support.
BulkDocument Bulk Document API http://docs.couchdb.org/en/1.6.1/api/database/bulk-api.html#db-bulk-docs.
BulkDocumentResult Bulk Document Response.
No description provided by the author
Cookie-based auth (for sessions).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Pass-through Auth header.
Proxy authentication.
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

Basic interface for Auth.