feat: Implement foundation layer with domain entities and repository interfaces
- Add complete domain layer: Note, Vault, WikiLink, Tag, Frontmatter, Graph entities - Implement repository interfaces for data access abstraction - Create comprehensive configuration system with YAML and env support - Add CLI entry point with signal handling and graceful shutdown - Fix mermaid diagram syntax in design.md (array notation) - Add CLAUDE.md for development guidance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
36
internal/repository/search_index.go
Normal file
36
internal/repository/search_index.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/user/obsidian-mcp-server/internal/domain"
|
||||
)
|
||||
|
||||
type SearchResult struct {
|
||||
Path string `json:"path"`
|
||||
Score float64 `json:"score"`
|
||||
Matches []*SearchMatch `json:"matches"`
|
||||
}
|
||||
|
||||
type SearchMatch struct {
|
||||
Line int `json:"line"`
|
||||
Content string `json:"content"`
|
||||
ContextBefore string `json:"context_before"`
|
||||
ContextAfter string `json:"context_after"`
|
||||
}
|
||||
|
||||
type SearchQuery struct {
|
||||
Query string
|
||||
MaxResults int
|
||||
CaseSensitive bool
|
||||
UseRegex bool
|
||||
ContextLines int
|
||||
}
|
||||
|
||||
type SearchIndex interface {
|
||||
Index(ctx context.Context, note *domain.Note) error
|
||||
Remove(ctx context.Context, path string) error
|
||||
Search(ctx context.Context, query *SearchQuery) ([]*SearchResult, error)
|
||||
Rebuild(ctx context.Context, notes []*domain.Note) error
|
||||
Clear() error
|
||||
}
|
||||
Reference in New Issue
Block a user