...

Text file src/github.com/go-kivik/kivik/v4/pouchdb/README.md

Documentation: github.com/go-kivik/kivik/v4/pouchdb

     1[![Go Reference](https://pkg.go.dev/badge/github.com/go-kivik/kivik/v4/pouchdb.svg)](https://pkg.go.dev/github.com/go-kivik/kivik/v4/pouchdb)
     2
     3# Kivik PouchDB
     4
     5PouchDB driver for [Kivik](https://github.com/go-kivik/pouchdb).
     6
     7## Installation
     8
     9Kivik 3.x and newer requires Go 1.11+, with Go modules enabled. At the time of
    10this writing, GopherJS still does not support Go modules (this is tracked at
    11[GopherJS Issue #855](https://github.com/gopherjs/gopherjs/issues/855)). Despite
    12this shortcoming of GopherJS, it is relatively straight forward to use the
    13standard Go toolchain as a dependency manager for GopherJS. I have written a
    14brief tutorial on this [here](https://jhall.io/posts/gopherjs-with-modules/),
    15with Kivik as an example.
    16
    17## Usage
    18
    19This package provides an implementation of the
    20[`github.com/go-kivik/kivik/v4/driver`](http://pkg.go.dev/github.com/go-kivik/kivik/v4/driver)
    21interface. You must import the driver and can then use the full
    22[`Kivik`](http://pkg.go.dev/github.com/go-kivik/kivik/v4) API.
    23
    24```go
    25//go:build js
    26
    27package main
    28
    29import (
    30    "context"
    31
    32    kivik "github.com/go-kivik/kivik/v4"
    33    _ "github.com/go-kivik/kivik/v4/pouchdb" // The PouchDB driver
    34)
    35
    36func main() {
    37    client, err := kivik.New(context.TODO(), "pouch", "")
    38    // ...
    39}
    40```
    41
    42This package is intended to run in a JavaScript runtime, such as a browser or
    43Node.js, and must be compiled with
    44[GopherJS](https://github.com/gopherjs/gopherjs). At runtime, the
    45[PouchDB](https://pouchdb.com/download.html) JavaScript library must also be
    46loaded and available.
    47
    48## What license is Kivik released under?
    49
    50This software is released under the terms of the Apache 2.0 license. See
    51LICENCE.md, or read the [full license](http://www.apache.org/licenses/LICENSE-2.0).

View as plain text