Documentation
¶
Overview ¶
Package docindex fetches and lists text documents (with metadata "front matter" at the top of each file) in a directory tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index represents a directory containing text documents with metadata.
func Open ¶
Open reads all documents in dir and its subdirectories. Metadata JSON is decoded into structs whose type is pointer-to-metadataType.
If dir is not an existing directory, an error satisfying os.IsNotExist is returned.
func (*Index) AllMetadata ¶
func (idx *Index) AllMetadata(metaMap interface{})
AllMetadata stores the metadata for each document in meta, which should be a map with string keys and values whose type is pointer-to-metadataType.
func (*Index) Doc ¶
Doc returns the data in the document named by filename. If meta is a pointer a struct of the metadataType used in Open, the document metadata is written to that struct.