pouchdb

package module
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

README

Build Status GoDoc

Kivik PouchDB

PouchDB driver for Kivik.

Installation

Kivik 3.x and newer requires Go 1.11+, with Go modules enabled. At the time of this writing, GopherJS still does not support Go modules (this is tracked at GopherJS Issue #855). Despite this shortcoming of GopherJS, it is relatively straight forward to use the standard Go toolchain as a dependency manager for GopherJS. I have written a brief tutorial on this here, with Kivik as an example.

Usage

This package provides an implementation of the github.com/go-kivik/kivik/driver 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.

// +build js

package main

import (
    "context"

    kivik "github.com/go-kivik/kivik/v3"
    _ "github.com/go-kivik/pouchdb/v3" // The PouchDB driver
)

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

This package is intended to run in a JavaScript runtime, such as a browser or Node.js, and must be compiled with GopherJS. At runtime, the PouchDB JavaScript library must also be loaded and available.

What license is Kivik released under?

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

Documentation

Overview

Package pouchdb provides a driver for the Kivik CouchDB package. It must be compiled with GopherJS, and requires that the PouchDB JavaScript library is also loaded at runtime.

// +build js

package main

import (
    "context"

    kivik "github.com/go-kivik/kivik/v3"
    _ "github.com/go-kivik/pouchdb/v3" // PouchDB driver
)

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

See https://github.com/go-kivik/pouchdb#usage for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Name     string
	Password string
}

BasicAuth handles HTTP Basic Auth for remote PouchDB connections. This is the only auth support built directly into PouchDB, so this is a very thin wrapper.

type Options

type Options map[string]interface{}

Options is a struct of options, as documented in the PouchDB API.

Directories

Path Synopsis
Package bindings provides minimal GopherJS bindings around the PouchDB library.
Package bindings provides minimal GopherJS bindings around the PouchDB library.
poucherr
Package poucherr exists only for the purpose of testing the PouchDB binding's handling of PouchDB-specific error messages.
Package poucherr exists only for the purpose of testing the PouchDB binding's handling of PouchDB-specific error messages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL