feat: wire context store scaffolding and dht test skeleton

This commit is contained in:
anthonyrawlins
2025-09-28 14:21:38 +10:00
parent d074520c30
commit ae021b47b9
7 changed files with 266 additions and 12 deletions

View File

@@ -0,0 +1,43 @@
package storage
import "context"
// noopIndexManager satisfies the IndexManager interface without maintaining indexes.
type noopIndexManager struct{}
// NewNoopIndexManager returns a no-op index manager implementation.
func NewNoopIndexManager() IndexManager {
return &noopIndexManager{}
}
func (n *noopIndexManager) CreateIndex(ctx context.Context, indexName string, config *IndexConfig) error {
return nil
}
func (n *noopIndexManager) UpdateIndex(ctx context.Context, indexName string, key string, data interface{}) error {
return nil
}
func (n *noopIndexManager) DeleteFromIndex(ctx context.Context, indexName string, key string) error {
return nil
}
func (n *noopIndexManager) Search(ctx context.Context, indexName string, query *SearchQuery) (*SearchResults, error) {
return &SearchResults{Query: query, Results: []*SearchResult{}}, nil
}
func (n *noopIndexManager) RebuildIndex(ctx context.Context, indexName string) error {
return nil
}
func (n *noopIndexManager) OptimizeIndex(ctx context.Context, indexName string) error {
return nil
}
func (n *noopIndexManager) GetIndexStats(ctx context.Context, indexName string) (*IndexStatistics, error) {
return &IndexStatistics{Name: indexName}, nil
}
func (n *noopIndexManager) ListIndexes(ctx context.Context) ([]string, error) {
return []string{}, nil
}