From 29df3b805d96ecc90207f22caab3d588fd50f8b7 Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Mon, 1 Apr 2024 09:41:38 -0400 Subject: [PATCH 1/2] Merged MutationFeedStore2, Collection into sgbucket.DataStore --- feeds.go | 16 ---------------- feeds_test.go | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/feeds.go b/feeds.go index 8f703bd..f294a69 100644 --- a/feeds.go +++ b/feeds.go @@ -23,10 +23,6 @@ var activeFeedCount int32 // for tests //////// BUCKET API: (sgbucket.MutationFeedStore interface) -func (bucket *Bucket) GetFeedType() sgbucket.FeedType { - return sgbucket.DcpFeedType -} - func (bucket *Bucket) StartDCPFeed( ctx context.Context, args sgbucket.FeedArguments, @@ -84,13 +80,6 @@ func (bucket *Bucket) StartDCPFeed( return nil } -func (wh *Bucket) StartTapFeed( - args sgbucket.FeedArguments, - dbStats *expvar.Map, -) (sgbucket.MutationFeed, error) { - return nil, &ErrUnimplemented{"rosmar bucket doesn't support tap feed, use DCP"} -} - //////// COLLECTION API: func (c *Collection) StartDCPFeed( @@ -350,8 +339,3 @@ func (e *event) asFeedEvent(collectionID uint32) *sgbucket.FeedEvent { } return &feedEvent } - -var ( - // Enforce interface conformance: - _ sgbucket.MutationFeedStore2 = &Bucket{} -) diff --git a/feeds_test.go b/feeds_test.go index a4219ed..2816df3 100644 --- a/feeds_test.go +++ b/feeds_test.go @@ -241,8 +241,8 @@ func TestCollectionMutations(t *testing.T) { require.NoError(t, err) numDocs := 50 - collectionID_1 := collection1.(sgbucket.Collection).GetCollectionID() - collectionID_2 := collection2.(sgbucket.Collection).GetCollectionID() + collectionID_1 := collection1.GetCollectionID() + collectionID_2 := collection2.GetCollectionID() // Add n docs to two collections for i := 1; i <= numDocs; i++ { diff --git a/go.mod b/go.mod index ee0d356..2677b7d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/couchbaselabs/rosmar go 1.19 require ( - github.com/couchbase/sg-bucket v0.0.0-20240326230241-0b197e169b27 + github.com/couchbase/sg-bucket v0.0.0-20240401133231-9ef001793228 github.com/google/uuid v1.6.0 github.com/mattn/go-sqlite3 v1.14.22 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 3cd7827..3996776 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/couchbase/sg-bucket v0.0.0-20240326230241-0b197e169b27 h1:FGNvJsAQk6JZzuVXvoLXcoSQzOnQxWkywzYJFQqzXEg= -github.com/couchbase/sg-bucket v0.0.0-20240326230241-0b197e169b27/go.mod h1:5me3TJLTPfR0s3aMJZcPoTu5FT8oelaINz5l7Q3cApE= +github.com/couchbase/sg-bucket v0.0.0-20240401133231-9ef001793228 h1:mbxL9mNjs5RLAC2qXJpz+VaCiq9Wkfzphka4IY1y9+8= +github.com/couchbase/sg-bucket v0.0.0-20240401133231-9ef001793228/go.mod h1:5me3TJLTPfR0s3aMJZcPoTu5FT8oelaINz5l7Q3cApE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From 00577ebd8f12c91d4b7aeb3b906146a9ec710a7c Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Tue, 2 Apr 2024 11:45:21 -0400 Subject: [PATCH 2/2] update go.mod from main --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2677b7d..8fbafe6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/couchbaselabs/rosmar go 1.19 require ( - github.com/couchbase/sg-bucket v0.0.0-20240401133231-9ef001793228 + github.com/couchbase/sg-bucket v0.0.0-20240402154301-12625d8851a8 github.com/google/uuid v1.6.0 github.com/mattn/go-sqlite3 v1.14.22 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 3996776..2066b3e 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/couchbase/sg-bucket v0.0.0-20240401133231-9ef001793228 h1:mbxL9mNjs5RLAC2qXJpz+VaCiq9Wkfzphka4IY1y9+8= -github.com/couchbase/sg-bucket v0.0.0-20240401133231-9ef001793228/go.mod h1:5me3TJLTPfR0s3aMJZcPoTu5FT8oelaINz5l7Q3cApE= +github.com/couchbase/sg-bucket v0.0.0-20240402154301-12625d8851a8 h1:kfWMYvUgSg2yIZJx+t63Ucl+zorvFqlYayXPkiXFtSE= +github.com/couchbase/sg-bucket v0.0.0-20240402154301-12625d8851a8/go.mod h1:5me3TJLTPfR0s3aMJZcPoTu5FT8oelaINz5l7Q3cApE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=