package module
Version: v1.7.2 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2017 License: Apache-2.0 Imports: 17 Imported by: 3


Build Status Codecov

Kivik CouchDB

CouchDB driver for Kivik.


This package provides an implementation of the interface. You must import the driver and can then use the full Kivik API. Please consult the Kivik wiki for complete documentation and coding examples.

package main

import (

    _ "" // The CouchDB driver

func main() {
    client, err := kivik.New(context.TODO(), "pouch", "")
    // ...


This software is released under the terms of the Apache 2.0 license. See, or read the full license.



Package couchdb is a driver for connecting with a CouchDB server over HTTP.



View Source
const (
	// OptionFullCommit is the option key used to set the `X-Couch-Full-Commit`
	// header in the request when set to true.
	// Example:
	//    db.Put(ctx, "doc_id", doc, kivik.Options{couchdb.OptionFullCommit: true})
	OptionFullCommit = "X-Couch-Full-Commit"

	// OptionIfNoneMatch sets the If-None-Match header on the request.
	// Example:
	//    row, err := db.Get(ctx, "doc_id", kivik.Options(couchdb.OptionIfNoneMatch: "1-xxx"))
	OptionIfNoneMatch = "If-None-Match"
View Source
const (
	CompatUnknown = iota

Compatibility modes

View Source
const (
	VendorCouchDB  = "The Apache Software Foundation"
	VendorCloudant = "IBM Cloudant"

Known vendor strings


This section is empty.


This section is empty.


type Authenticator added in v1.7.0

type Authenticator interface {
	// contains filtered or unexported methods

Authenticator is a CouchDB authenticator.

func SetTransport added in v1.7.0

func SetTransport(t http.RoundTripper) Authenticator

SetTransport returns an authenticator that can be used to set a client connection's HTTP Transport. This can be used to control proxies, TLS configuration, keep-alives, compression, etc.


setXport := couchdb.SetTransport(&http.Transport{
    // .. custom config
client, _ := kivik.New( ... )

type CompatMode

type CompatMode int

CompatMode is a flag indicating the compatibility mode of the driver.

type Couch

type Couch struct{}

Couch represents the parent driver instance.

func (*Couch) NewClient

func (d *Couch) NewClient(ctx context.Context, dsn string) (driver.Client, error)

NewClient establishes a new connection to a CouchDB server instance. If auth credentials are included in the URL, they are used to authenticate using CookieAuth (or BasicAuth if compiled with GopherJS). If you wish to use a different auth mechanism, do not specify credentials here, and instead call Authenticate() later.


Path Synopsis
Package chttp provides a minimal HTTP driver backend for communicating with CouchDB servers.
Package chttp provides a minimal HTTP driver backend for communicating with CouchDB servers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL