Skip to content

Commit

Permalink
GOCBC-277: Add FTS Index Management
Browse files Browse the repository at this point in the history
Motivation
----------
Search index management is required for integration test scaffolding.
It can be also used for administrative tools development.

Changes
-------
Added a SearchIndexManager to provide functionality to manage
search indexes.

Change-Id: I25d9b12cfac714d653571ec4002488e4d804bc28
Reviewed-on: http://review.couchbase.org/94056
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Charles Dixon <chvckd@gmail.com>
  • Loading branch information
chvck committed May 15, 2018
1 parent eb00485 commit c4325e2
Show file tree
Hide file tree
Showing 6 changed files with 1,241 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

var globalBucket *Bucket
var globalMock *gojcbmock.Mock
var globalCluster *Cluster

func TestMain(m *testing.M) {
SetLogger(VerboseStdioLogger())
Expand All @@ -30,13 +31,13 @@ func TestMain(m *testing.M) {

connStr := fmt.Sprintf("http://127.0.0.1:%d", globalMock.EntryPort)

cluster, err := Connect(connStr)
globalCluster, err = Connect(connStr)

if err != nil {
panic(err.Error())
}

globalBucket, err = cluster.OpenBucket("default", "")
globalBucket, err = globalCluster.OpenBucket("default", "")

if err != nil {
panic(err.Error())
Expand Down
1 change: 1 addition & 0 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (c *Cluster) Manager(username, password string) *ClusterManager {
TLSClientConfig: tlsConfig,
},
},
cluster: c,
}
}

Expand Down
8 changes: 8 additions & 0 deletions clustermgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type ClusterManager struct {
username string
password string
httpCli *http.Client
cluster *Cluster
}

// BucketType specifies the kind of bucket
Expand Down Expand Up @@ -406,3 +407,10 @@ func (cm *ClusterManager) RemoveUser(domain AuthDomain, name string) error {

return nil
}

// SearchIndexManager returns a SearchIndexManager for performing FTS index management on this cluster
func (cm *ClusterManager) SearchIndexManager() *SearchIndexManager {
return &SearchIndexManager{
cm: cm,
}
}
Loading

0 comments on commit c4325e2

Please sign in to comment.