Skip to content

Commit

Permalink
Merge pull request #990 from go-kivik/int2
Browse files Browse the repository at this point in the history
Use top-level `int` package instead of local `internal` package for DRY
  • Loading branch information
flimzy committed Jun 3, 2024
2 parents a20699b + c0217b4 commit f10ae24
Show file tree
Hide file tree
Showing 38 changed files with 37 additions and 236 deletions.
2 changes: 1 addition & 1 deletion x/sqlite/changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

func TestDBChanges(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"testing"

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

type DB interface {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"net/http"

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

func (d *db) Delete(ctx context.Context, docID string, options driver.Options) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

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

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

func (d *db) DeleteAttachment(ctx context.Context, docID, filename string, options driver.Options) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/deleteattachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

func TestDBDeleteAttachment(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/designdocs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

func TestDBDesignDocs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

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

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

func (d *db) GetAttachment(ctx context.Context, docID string, filename string, options driver.Options) (*driver.Attachment, error) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/getattachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

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

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

func (d *db) GetAttachmentMeta(ctx context.Context, docID, filename string, options driver.Options) (*driver.Attachment, error) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/getattachmentmeta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

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

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

func (d *db) GetRev(ctx context.Context, id string, options driver.Options) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/getrev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

func TestGetRev(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.0
require (
github.com/cenkalti/backoff/v4 v4.3.0
github.com/dop251/goja v0.0.0-20240220182346-e401ed450204
github.com/go-kivik/kivik/v4 v4.2.2
github.com/go-kivik/kivik/v4 v4.2.4-0.20240603093710-a20699b64fe0
github.com/google/go-cmp v0.6.0
github.com/mitchellh/mapstructure v1.5.0
gitlab.com/flimzy/testy v0.14.0
Expand Down
4 changes: 2 additions & 2 deletions x/sqlite/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-kivik/kivik/v4 v4.2.2 h1:07eHTCuCMZ9q5/XgOJ4nxDmSZnBt9S+lu0woyMij/nQ=
github.com/go-kivik/kivik/v4 v4.2.2/go.mod h1:cLPiFNZYSL1BB6y+atQrLQ/4+TJd4DsdvGW6iIyIIiY=
github.com/go-kivik/kivik/v4 v4.2.4-0.20240603093710-a20699b64fe0 h1:BL87nAqElmPct8tksu/p5QJIrHsDRQ/U0jjPcn1FZr0=
github.com/go-kivik/kivik/v4 v4.2.4-0.20240603093710-a20699b64fe0/go.mod h1:CJhEne5eDT6YWSWCfJ96uaYB+uAc3UamvmkfHDnozeM=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
Expand Down
173 changes: 0 additions & 173 deletions x/sqlite/internal/errors.go

This file was deleted.

26 changes: 0 additions & 26 deletions x/sqlite/internal/mock/options.go

This file was deleted.

2 changes: 1 addition & 1 deletion x/sqlite/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"strconv"
"strings"

"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

type revision struct {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/localdocs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

func TestDBLocalDocs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/openrevs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

func (d *db) OpenRevs(ctx context.Context, docID string, revs []string, options driver.Options) (driver.Rows, error) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/openrevs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/go-kivik/kivik/v4"
"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal/mock"
"github.com/go-kivik/kivik/v4/int/mock"
)

func TestDBOpenRevs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/sqlite/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strconv"

"github.com/go-kivik/kivik/v4/driver"
"github.com/go-kivik/kivik/x/sqlite/v4/internal"
internal "github.com/go-kivik/kivik/v4/int/errors"
)

type optsMap map[string]interface{}
Expand Down

0 comments on commit f10ae24

Please sign in to comment.