catalog

package
v0.0.0-...-8f845b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	sync.Mutex
	// contains filtered or unexported fields
}

A Catalog represents a physical file tree and its indexed, virtual tree.

func NewCatalog

func NewCatalog(log *logging.Logger, config *config.Configuration) *Catalog

NewCatalog returns a new instance of a Catalog structure. It will create the initial index and start a directory watcher for the physical file structure.

func (*Catalog) FindTerm

func (catalog *Catalog) FindTerm(searchTerm string) *document.Term

FindTerm searches the tree for a specific term.

func (*Catalog) Index

func (catalog *Catalog) Index() error

Index creates the virtual index tree. This operation locks the catalog.

func (*Catalog) Search

func (catalog *Catalog) Search(searchTerm string) []*document.Term

Search searches the tree for nodes containing a term. This uses a depth-first pre-order traversal.

func (*Catalog) ToJSON

func (catalog *Catalog) ToJSON() string

ToJSON returns a pretty printed string of this catalog as JSON

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL