MCPcopy Index your code
hub / github.com/couchbase/cbft

github.com/couchbase/cbft @v0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.0 ↗ · + Follow
1,334 symbols 3,157 edges 109 files 207 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

For cbft developers

Dev environment setup

go get -u github.com/couchbase/cbft/...
cd $GOPATH/src/github.com/couchbase/cbft
make prereqs

Building cbft

make

Unit tests

make test

Coverage reports

To get local coverage reports with heatmaps...

make coverage

To get more coverage reports that include dependencies like the bleve library...

go test -coverpkg github.com/couchbase/cbft,github.com/blevesearch/bleve,github.com/blevesearch/bleve/index \
    -coverprofile=coverage.out \
    -covermode=count && \
go tool cover -html=coverage.out

Documentation

Generating documentation...

We use the MkDocs tool to help generate an HTML docs website from the markdown files in the ./docs subdirectory.

To generate the REST API markdown documentation...

make gen-docs

For a local development testing web server that automatically re-generates the HTML website of ./docs changes, run...

mkdocs serve

Then browse to http://127.0.0.1:8000 to see the HTML docs website.

To deploy the HTML docs website to github's gh-pages, run...

mkdocs gh-deploy

Coding conventions

You must pass go fmt.

Error message conventions...

In the cbft project, fmt.Errorf() and log.Printf() messages follow a rough formatting convention, like...

<source_file_base_name>: <short static msg string>, <arg0>: <val0>, <arg1>: <val1>

The "short static msg string" should be unique enough so that git grep works well.

Contributing fixes/improvements

We require a contributor license agreement (CLA) to be signed before we can merge any pull requests. To sign this agreement, please register at the couchbase code review site. The cbft project currently does not use this code review app, but it is still used to track acceptance of the CLA.

All types of contributions are welcome, but please keep the following in mind:

Existing tests should continue to pass ("make test"), and new tests for contributions are quite nice to have.

All code should have pass "go fmt ./..." and "go vet ./...".

Releasing

To do a full release with a new (semver) tag, see the Makefile's "release" target.

For Couchbase Server developers

For running using Couchbase Server's cluster_run (in watson and beyond)...

cd (your dev directory where you ran 'repo sync' for couchbase server watson.xml)
make -j 9
mkdir -p install/lib/fts
rm -rf install/lib/fts/static
rm -rf install/lib/fts/static-bleve-mapping
rm -rf install/lib/fts/staticx
ln -s ../../../goproj/src/github.com/couchbase/cbft/staticx/ install/lib/fts
ln -s ../../../goproj/src/github.com/couchbase/cbgt/rest/static/ install/lib/fts
ln -s ../../../godeps/src/github.com/blevesearch/bleve-mapping-ui/static-bleve-mapping/ install/lib/fts
cp goproj/src/github.com/couchbase/cbft/ns_server_static/fts/* install/lib/fts
cd ns_server
./cluster_run --pluggable-config="../build/goproj/src/github.com/couchbase/cbft/pluggable-ui-fts.cluster_run.json"

Extension points exported contracts — how you extend this code

RemoteClient (Interface)
RemoteClient represents a generic interface to be implemented by all remote clients like IndexClient/GrpcClient. [2 implementers]
remote.go
JSONStatsWriter (Interface)
--------------------------------------------------------- [1 implementers]
pindex_bleve.go
PartitionSeqsProvider (Interface)
PartitionSeqsProvider represents source object that can provide partition seqs, such as some pindex or dest implementati [1 …
ns_server.go
LowerLevelStoreHolder (Interface)
(no doc)
pindex_bleve_moss_rollback.go
BleveInterface (Interface)
(no doc)
pindex_bleve_doc.go
BleveIndexCollector (Interface)
BleveIndexCollector interface is a subset of the bleve.IndexAlias interface, with just the Add() method, allowing altern
pindex_bleve.go
MossStoreActualHolder (Interface)
(no doc)
pindex_bleve_moss_rollback.go

Core symbols most depended-on inside this repo

Unmarshal
called by 84
unmarshal.go
Write
called by 48
rest.go
Marshal
called by 42
marshal.go
Get
called by 36
pindex_bleve.go
UnmarshalJSON
called by 23
unmarshal.go
Close
called by 23
remote.go
Name
called by 22
remote.go
showError
called by 21
http/util.go

Shape

Function 617
Method 549
Struct 140
Interface 15
TypeAlias 6
FuncType 5
Class 2

Languages

Go92%
TypeScript8%

Modules by API surface

protobuf/search.pb.go196 symbols
bindata_assetfs.go119 symbols
pindex_bleve.go97 symbols
ns_server.go43 symbols
remote.go42 symbols
grpc_client.go40 symbols
ns_server_static/fts/fts.js35 symbols
query_supervisor.go31 symbols
cache_bleve.go29 symbols
rest_test.go27 symbols
rest_auth.go27 symbols
missing.go26 symbols

For agents

$ claude mcp add cbft \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact