Skip to content

Commit

Permalink
Upgrade to latest gocbcore version.
Browse files Browse the repository at this point in the history
Change-Id: I1b1e2c7d962c81fd1f3ce63ab64f12780dd4e162
Reviewed-on: http://review.couchbase.org/77077
Reviewed-by: Mark Nunberg <mark.nunberg@couchbase.com>
Tested-by: Brett Lawson <brett19@gmail.com>
  • Loading branch information
brett19 committed Apr 20, 2017
1 parent f6356f3 commit 50b9ce9
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 21 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 (
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
"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 (
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

// Get 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 (
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

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 (
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

// BucketInternal holds various internally used bucket extension methods.
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 (
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

type bulkOp struct {
Expand Down
6 changes: 3 additions & 3 deletions bucket_subdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package gocb

import (
"encoding/json"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
"log"
)

Expand Down Expand Up @@ -132,7 +132,7 @@ func (set *LookupInBuilder) Exists(path string) *LookupInBuilder {

func (b *Bucket) lookupIn(set *LookupInBuilder) (resOut *DocumentFragment, errOut error) {
signal := make(chan bool, 1)
op, err := b.client.SubDocLookup([]byte(set.name), set.ops,
op, err := b.client.SubDocLookup([]byte(set.name), set.ops, 0,
func(results []gocbcore.SubDocResult, cas gocbcore.Cas, err error) {
errOut = err

Expand Down Expand Up @@ -527,7 +527,7 @@ func (b *Bucket) mutateIn(set *MutateInBuilder) (resOut *DocumentFragment, errOu
}

signal := make(chan bool, 1)
op, err := b.client.SubDocMutate([]byte(set.name), set.ops, set.cas, set.expiry,
op, err := b.client.SubDocMutate([]byte(set.name), set.ops, 0, set.cas, set.expiry,
func(results []gocbcore.SubDocResult, cas gocbcore.Cas, mt gocbcore.MutationToken, err error) {
errOut = err
if errOut == nil {
Expand Down
9 changes: 9 additions & 0 deletions bucket_subdoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ func TestSubDocXattrs(t *testing.T) {
t.Fatalf("Failed to sub-doc mutate (%s)", err)
}

/* DISABLED DUE TO LACK OF MOCK SUPPORT
_, err = globalBucket.MutateInEx("subDocMkDoc", SubdocDocFlagMkDoc,0, 0).
UpsertEx("x", "x value 4", SubdocFlagNone).
Execute()
if err != nil {
t.Fatalf("Failed to sub-doc mkdoc mutate (%s)", err)
}
*/

res, err := globalBucket.LookupIn("subDocXattrs").
GetEx("xatest", SubdocFlagXattr).
GetEx("x", SubdocFlagNone).
Expand Down
2 changes: 1 addition & 1 deletion cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gocb
import (
"errors"
"fmt"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
"gopkg.in/couchbaselabs/gocbconnstr.v1"
"net/http"
"strconv"
Expand Down
8 changes: 1 addition & 7 deletions constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gocb

import (
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

const (
Expand Down Expand Up @@ -46,19 +46,13 @@ const (
// SubdocFlagNone indicates no special behaviours
SubdocFlagNone = SubdocFlag(gocbcore.SubdocFlagNone)

// SubdocFlagCreateDoc indicates you wish to create the document if it does not exist.
SubdocFlagCreateDoc = SubdocFlag(gocbcore.SubdocFlagMkDoc)

// SubdocFlagCreatePath indicates you wish to recursively create the tree of paths
// if it does not already exist within the document.
SubdocFlagCreatePath = SubdocFlag(gocbcore.SubdocFlagMkDirP)

// SubdocFlagXattr indicates your path refers to an extended attribute rather than the document.
SubdocFlagXattr = SubdocFlag(gocbcore.SubdocFlagXattrPath)

// SubdocFlagAccessDeleted indicates that you wish to receive soft-deleted documents.
SubdocFlagAccessDeleted = SubdocFlag(gocbcore.SubdocFlagAccessDeleted)

// SubdocFlagUseMacros indicates that you wish macro substitution to occur on the value
SubdocFlagUseMacros = SubdocFlag(gocbcore.SubdocFlagExpandMacros)
)
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"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
"strings"
)

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

import (
"fmt"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
"log"
"strings"
)
Expand Down
2 changes: 1 addition & 1 deletion token.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gocb
import (
"encoding/json"
"fmt"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

// MutationToken holds the mutation state information from an operation.
Expand Down
2 changes: 1 addition & 1 deletion token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package gocb

import (
"encoding/json"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
"strings"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion transcoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package gocb

import (
"encoding/json"
"gopkg.in/couchbase/gocbcore.v6"
"gopkg.in/couchbase/gocbcore.v7"
)

// Transcoder provides an interface for transforming Go values to and
Expand Down

0 comments on commit 50b9ce9

Please sign in to comment.