feat: wire context store scaffolding and dht test skeleton
This commit is contained in:
43
pkg/slurp/storage/index_manager_noop.go
Normal file
43
pkg/slurp/storage/index_manager_noop.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user