Skip to content

Commit

Permalink
Update paths for v4
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy committed Feb 16, 2020
1 parent 5fd43ed commit d8bb5a4
Show file tree
Hide file tree
Showing 60 changed files with 120 additions and 107 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CouchDB driver for [Kivik](https://github.com/go-kivik/kivik).
## Usage

This package provides an implementation of the
[`github.com/go-kivik/kivik/v3/driver`](http://godoc.org/github.com/go-kivik/kivik/driver)
[`github.com/go-kivik/kivik/v4/driver`](http://godoc.org/github.com/go-kivik/kivik/driver)
interface. You must import the driver and can then use the full
[`Kivik`](http://godoc.org/github.com/go-kivik/kivik) API. Please consult the
[Kivik wiki](https://github.com/go-kivik/kivik/wiki) for complete documentation
Expand All @@ -19,8 +19,8 @@ package main
import (
"context"

kivik "github.com/go-kivik/kivik/v3"
_ "github.com/go-kivik/couchdb/v3" // The CouchDB driver
kivik "github.com/go-kivik/kivik/v4"
_ "github.com/go-kivik/couchdb/v4" // The CouchDB driver
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"errors"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

func (d *db) PutAttachment(ctx context.Context, docID, rev string, att *driver.Attachment, options map[string]interface{}) (newRev string, err error) {
Expand Down
2 changes: 1 addition & 1 deletion attachments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

type closer struct {
Expand Down
4 changes: 2 additions & 2 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
)

func (c *client) Authenticate(ctx context.Context, a interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
)

type mockAuther struct {
Expand Down
6 changes: 3 additions & 3 deletions bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"io"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

type bulkResults struct {
Expand Down
4 changes: 2 additions & 2 deletions bulk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"gitlab.com/flimzy/testy"

kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

func TestBulkDocs(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions bulkget.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
"github.com/go-kivik/kivik/v4/driver"
)

func (d *db) BulkGet(ctx context.Context, docs []driver.BulkGetReference, opts map[string]interface{}) (driver.Rows, error) {
Expand Down
2 changes: 1 addition & 1 deletion bulkget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

func TestBulkGet(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"io"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

// Changes returns the changes stream for the database.
Expand Down
2 changes: 1 addition & 1 deletion changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

func TestChanges(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion chttp/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"gitlab.com/flimzy/testy"
"golang.org/x/net/publicsuffix"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

type mockRT struct {
Expand Down
2 changes: 1 addition & 1 deletion chttp/chttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"sync"
"syscall"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion chttp/chttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"gitlab.com/flimzy/testy"
"golang.org/x/net/publicsuffix"

"github.com/go-kivik/kivik/v3/errors"
"github.com/go-kivik/kivik/v4/errors"
)

var defaultUA = func() string {
Expand Down
2 changes: 1 addition & 1 deletion chttp/cookieauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net/http"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

// CookieAuth provides CouchDB Cookie auth services as described at
Expand Down
2 changes: 1 addition & 1 deletion chttp/cookieauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"gitlab.com/flimzy/testy"
"golang.org/x/net/publicsuffix"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

func TestCookieAuthAuthenticate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion chttp/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"gitlab.com/flimzy/testy"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

func TestHTTPErrorError(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"
"strings"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

func (c *client) AllDBs(ctx context.Context, opts map[string]interface{}) ([]string, error) {
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

func TestAllDBs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
"github.com/go-kivik/couchdb/v4/chttp"
)

func (c *client) ClusterStatus(ctx context.Context, opts map[string]interface{}) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"gitlab.com/flimzy/testy"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

const optionEnsureDBsExist = "ensure_dbs_exist"
Expand Down
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"net/http"
"strings"

"github.com/go-kivik/couchdb/v3/chttp"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
"github.com/go-kivik/kivik/v4/driver"
)

// Couch1ConfigNode can be passed to any of the Config-related methods as the
Expand Down
2 changes: 1 addition & 1 deletion config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/pkg/errors"
"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

func TestConfig(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions couchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"net/http"
"sync"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

// Couch represents the parent driver instance.
Expand Down
2 changes: 1 addition & 1 deletion couchdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"gitlab.com/flimzy/testy"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

func TestNewClient(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"strings"
"sync"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

type db struct {
Expand Down
10 changes: 5 additions & 5 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/couchdb/v3/chttp"
kivik "github.com/go-kivik/kivik/v3"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
kivik "github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
)

func TestAllDocs(t *testing.T) {
Expand Down Expand Up @@ -1181,14 +1181,14 @@ func TestRowsQuery(t *testing.T) {
"X-Couch-Request-ID": {"a9688d9335"},
"X-Couch-Body-Time": {"0"},
},
Body: ioutil.NopCloser(strings.NewReader(`{"total_rows":1,"offset":0,"update_seq":"13-g1AAAAEzeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjPlsQBJhgdA6j8QZCUy4FV3AKLuflYiE151DRB18wmZtwCibj9u85ISgGRSPV63JSmA1NiD1bDgUJPIkCSP3xAHkCHxYDWsWQDg12MD","rows":[
Body: ioutil.NopCloser(strings.NewReader(`{"total_rows":1,"offset":0,"update_seq":"13-g1AAAAEzeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjPlsQBJhgdA6j8QZCUy4Fv4AKLuflYiE151DRB18wmZtwCibj9u85ISgGRSPV63JSmA1NiD1bDgUJPIkCSP3xAHkCHxYDWsWQDg12MD","rows":[
{"id":"_design/_auth","key":"_design/_auth","value":{"rev":"1-75efcce1f083316d622d389f3f9813f7"}}
]}
`)),
}, nil),
expected: queryResult{
TotalRows: 1,
UpdateSeq: "13-g1AAAAEzeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjPlsQBJhgdA6j8QZCUy4FV3AKLuflYiE151DRB18wmZtwCibj9u85ISgGRSPV63JSmA1NiD1bDgUJPIkCSP3xAHkCHxYDWsWQDg12MD",
UpdateSeq: "13-g1AAAAEzeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjPlsQBJhgdA6j8QZCUy4Fv4AKLuflYiE151DRB18wmZtwCibj9u85ISgGRSPV63JSmA1NiD1bDgUJPIkCSP3xAHkCHxYDWsWQDg12MD",
Rows: []driver.Row{
{
ID: "_design/_auth",
Expand Down
4 changes: 2 additions & 2 deletions dbstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"encoding/json"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
"github.com/go-kivik/kivik/v4/driver"
)

type dbStats struct {
Expand Down
2 changes: 1 addition & 1 deletion dbstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

func TestStats(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Use the `couch` driver name when using this driver. The DSN should be a full
URL, likely with login credentials:
import (
kivik "github.com/go-kivik/kivik/v3"
_ "github.com/go-kivik/couchdb/v3" // The CouchDB driver
kivik "github.com/go-kivik/kivik/v4"
_ "github.com/go-kivik/couchdb/v4" // The CouchDB driver
)
client, err := kivik.New("couch", "http://username:[email protected]:5984/")
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

kivik "github.com/go-kivik/kivik/v3"
kivik "github.com/go-kivik/kivik/v4"
)

func missingArg(arg string) error {
Expand Down
4 changes: 2 additions & 2 deletions find.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/http"

"github.com/go-kivik/couchdb/v3/chttp"
"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/couchdb/v4/chttp"
"github.com/go-kivik/kivik/v4/driver"
)

func (d *db) CreateIndex(ctx context.Context, ddoc, name string, index interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"gitlab.com/flimzy/testy"

"github.com/go-kivik/kivik/v3/driver"
"github.com/go-kivik/kivik/v4/driver"
)

func TestExplain(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module github.com/go-kivik/couchdb/v3
module github.com/go-kivik/couchdb/v4

go 1.13

require (
github.com/go-kivik/couchdb/v3 v3.0.0-20200214171159-5fd43ed7e3a7
github.com/go-kivik/kivik/v3 v3.0.0-pre1
github.com/go-kivik/kivik/v4 v4.0.0-20200214160900-846fe547c809
github.com/go-kivik/kiviktest/v3 v3.0.0-pre1
github.com/go-kivik/kiviktest/v4 v4.0.0-20200214165217-a51629876bec
github.com/gopherjs/gopherjs v0.0.0-20200209144316-f9cef593def5
github.com/pkg/errors v0.9.1
gitlab.com/flimzy/testy v0.0.2
Expand Down
Loading

0 comments on commit d8bb5a4

Please sign in to comment.