hako/internal/extractors/extractor.go
2026-01-12 19:35:18 +01:00

25 lines
760 B
Go

package extractors
import (
"context"
)
// Extractor defines the interface for content extraction tools
// that extract text content from archived files for search purposes
type Extractor interface {
// Key returns the unique identifier for this extractor
Key() string
// Name returns the human-readable name for this extractor
Name() string
// SupportedMimeTypes returns the list of MIME types this extractor can handle
SupportedMimeTypes() []string
// Extract extracts text content from a file at the given path
Extract(ctx context.Context, filePath string) (string, error)
// Init initializes the extractor and validates its availability
// Returns an error if the extractor cannot be used (e.g., required binary not found)
Init() error
}