Search the codebase for the knirvbase package API definitions. Specifically:
Find the knirvbase.DB interface definition - search for type DB interface or type DB struct in any file that has package knirvbase
Find the knirvbase.Collection interface definition - search for type Collection interface or type Collection struct in knirvbase
Find any Flight stream related code - FlightStream, Flight, Stream in knirvbase
Find how collections are created/accessed - methods like Collection(name string) or NewCollection
The knirvbase package is at github.com/knirvcorp/knirvbase/pkg/knirvbase - check the go module cache at ~/go/pkg/mod/github.com/knirvcorp/knirvbase* or in the vendor directory if there is one.
Return all relevant interface definitions and method signatures.
Assistant
I'll start by searching for the knirvbase package in multiple locations simultaneously.
Assistant
Found the knirvbase package locally at packages/KNIRVBASE/pkg/knirvbase/. Let me read the source files and the go.mod to understand the module structure.
Assistant
Now let me explore the internal packages for the collection, database, and storage implementations, plus search for any Flight stream related code.
Assistant
Excellent -- found a Flight server in the network layer. Let me read the key internal files to get the full interface and implementation details.
Assistant
Now let me read the Flight server and types files to complete the picture.
Assistant
Let me check the network package for additional files and verify the DistributedCollection.FindAll implementation:
Assistant
Here is a comprehensive report of all the knirvbase API definitions found across the codebase.
Implementation adapter (private, collectionAdapter at line 135) delegates to coll.DistributedCollection.
The underlying DistributedCollection (in internal/collection/distributed_collection.go) has an additional method not exposed through the public Collection interface:
StreamBrackets(ctx context.Context, goldOnly bool) (<-chan *nrv.Bracket, error) -- only works if the storage backend is *stor.NRVStorage; otherwise returns an error.
3. How Collections are Created/Accessed
Chained flow:
User calls db.Collection(name) on the public *knirvbase.DB struct (line 62 of knirvbase.go).
This calls d.db.Collection(name, d.store) on DistributedDatabase (internal/database/distributed_database.go, line 60).
DistributedDatabase checks its internal map; if not found, it calls coll.NewDistributedCollection(name, db.network, store) (internal/collection/distributed_collection.go, line 104).
NewDistributedCollection creates an internal LocalCollection(name, store) plus sets up CRDT-based network sync via message handlers.