Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned by the indexer when attempting to look up a document that does not exist. ErrNotFound = errors.New("not found") // ErrMissingLinkID is returned when attempting to index a document that does not specify a valid link ID ErrMissingLinkID = errors.New("document does not provide a valid linkID") )
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct { LinkID uuid.UUID URL string Title string Content string IndexedAt time.Time PageRank float64 }
Document describes a web page whose content has been indexed by this service
type Indexer ¶
type Indexer interface { Index(doc *Document) error FindByID(linkID uuid.UUID) (*Document, error) Search(query Query) (Iterator, error) UpdateScore(linkID uuid.UUID, score float64) error }
Indexer is implemented by objects that can index and search documents discovered
type Iterator ¶
type Iterator interface { Close() error Next() bool Error() error Document() *Document TotalCount() uint64 }
Iterator is implemented by objects that can paginate search results
Click to show internal directories.
Click to hide internal directories.