Documentation
¶
Overview ¶
Package docs implements a corpus of text documents identified by document IDs. It allows retrieving the documents by ID as well as retrieving documents that are new since a previous scan.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Corpus ¶
type Corpus struct {
// contains filtered or unexported fields
}
A Corpus is the collection of documents stored in a database.
func (*Corpus) Add ¶
Add adds a document with the given id, title, and text. If the document already exists in the corpus with the same title and text, Add is an no-op. Otherwise, if the document already exists in the corpus, it is replaced.
func (*Corpus) DocWatcher ¶
DocWatcher returns a new storage.Watcher with the given name. It picks up where any previous Watcher of the same name left off.
func (*Corpus) Docs ¶
Docs returns an iterator over all documents in the corpus with IDs starting with a given prefix. The documents are ordered by ID.