Skip to content

Commit

Permalink
Move gocbcore and ancillary packages to their own repositories.
Browse files Browse the repository at this point in the history
Major project restructuring required to fix issues with versioning
of this package in relation to the 'internal' packages it was
depending on.

Change-Id: I7623923365e5c08cd9e446613aa9c1e7b35fe9c0
Reviewed-on: http://review.couchbase.org/70905
Reviewed-by: Mark Nunberg <mark.nunberg@couchbase.com>
Tested-by: Brett Lawson <brett19@gmail.com>
  • Loading branch information
brett19 committed Dec 13, 2016
1 parent 63b4d73 commit add6f31
Show file tree
Hide file tree
Showing 50 changed files with 42 additions and 6,787 deletions.
2 changes: 1 addition & 1 deletion bucket.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gocb

import (
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
"math/rand"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion bucket_crud.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gocb

import (
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
)

// Retrieves a document from the bucket
Expand Down
2 changes: 1 addition & 1 deletion bucket_dura.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gocb

import (
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
)

func (b *Bucket) observeOnceCas(key []byte, cas Cas, forDelete bool, replicaIdx int, commCh chan uint) (pendingOp, error) {
Expand Down
2 changes: 1 addition & 1 deletion bucket_internal.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gocb

import (
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
)

// *INTERNAL*
Expand Down
2 changes: 1 addition & 1 deletion bucket_multi.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gocb

import (
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
)

type bulkOp struct {
Expand Down
2 changes: 1 addition & 1 deletion bucket_subdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package gocb

import (
"encoding/json"
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
"log"
)

Expand Down
12 changes: 6 additions & 6 deletions bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ package gocb
import (
"flag"
"fmt"
"github.com/couchbase/gocb/gocbcore/javamock"
"gopkg.in/couchbaselabs/gojcbmock.v1"
"os"
"testing"
)

var globalBucket *Bucket
var globalMock *gocbmock.Mock
var globalMock *gojcbmock.Mock

func TestMain(m *testing.M) {
flag.Parse()
mpath, err := gocbmock.GetMockPath()
mpath, err := gojcbmock.GetMockPath()
if err != nil {
panic(err.Error())
}

globalMock, err = gocbmock.NewMock(mpath, 4, 1, 64, []gocbmock.BucketSpec{
{Name: "default", Type: gocbmock.BCouchbase},
{Name: "memd", Type: gocbmock.BMemcached},
globalMock, err = gojcbmock.NewMock(mpath, 4, 1, 64, []gojcbmock.BucketSpec{
{Name: "default", Type: gojcbmock.BCouchbase},
{Name: "memd", Type: gojcbmock.BMemcached},
}...)

if err != nil {
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 (
"crypto/tls"
"crypto/x509"
"errors"
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
"io/ioutil"
"net/http"
"sync"
Expand Down
6 changes: 3 additions & 3 deletions cluster_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/couchbase/gocb/jsonx"
"gopkg.in/brett19/jsonx.v1"
"net/http"
"time"
)
Expand Down Expand Up @@ -581,14 +581,14 @@ func (c *Cluster) doSearchQuery(b *Bucket, q *SearchQuery) (SearchResults, error
}
}

qTimeout := jsonx.MillisecondDuration(timeout)
qTimeout := jsonMillisecondDuration(timeout)
if ctlData.Has("timeout") {
err := ctlData.Get("timeout", &qTimeout)
if err != nil {
return nil, err
}
if qTimeout <= 0 || time.Duration(qTimeout) > timeout {
qTimeout = jsonx.MillisecondDuration(timeout)
qTimeout = jsonMillisecondDuration(timeout)
}
}
ctlData.Set("timeout", qTimeout)
Expand Down
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package gocb

import (
"errors"
"github.com/couchbase/gocb/gocbcore"
"gopkg.in/couchbase/gocbcore.v2"
)

type clientError struct {
Expand Down
Loading

0 comments on commit add6f31

Please sign in to comment.