44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| 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
 | |
| }
 | 
