A search application for searching objects inside json files.
Run go run ./cmd/pestotrap
and search for jokes on http://localhost:8090
/internal/demo contains some example data and configuration. The data type joke is defined by how the files are named.
- /internal/demo/data/foo.joke is a file containing many joke objects stored as json. There is another file named bar.joke.
- /internal/demo/config/joke.jq is a jq script that converts joke data files into searchable objects.
- /internal/demo/templates/joke.tmpl is a html template that renders one joke object.
/pkg should be reusable outside this project.
- /pkg/dirindex can watch a directory for changes and re-index when needed.
- /pkg/filetypes defines interfaces for setting up processing of custom file types.
- /pkg/searchpage serves the search page.
See example usage in /cmd/pestotrap/main.go an /internal/documents.