Documentation
¶
Overview ¶
Package readsearch is the API route running a saved search.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(db bun.IDB) http.HandlerFunc
Handler runs a saved search and lists the notes it matches: GET /api/searches/{id}?limit=&offset=, X-Total-Count counting the matches. @Summary Run a saved search @Tags searches @Produce json @Param id path string true "saved search id" @Param limit query integer false "matches in the page, all when left out or 0" @Param offset query integer false "matches skipped before the page" @Success 200 {array} runsavedsearch.Match @Header 200 {integer} X-Total-Count "the matches, not only the page: those read, and the notes after them that may match" @Failure 404 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/searches/{id} [get]
func Preview ¶
func Preview(db bun.IDB) http.HandlerFunc
Preview runs criteria not saved yet, for the smart folder dialog to show what they match: POST /api/searches?limit=, X-Total-Count counting the matches. The name and id of the body are ignored. @Summary Run criteria not saved yet @Tags searches @Accept json @Produce json @Param body body domain.SavedSearch true "criteria" @Param limit query integer false "matches in the page, all when left out or 0" @Param offset query integer false "matches skipped before the page" @Success 200 {array} runsavedsearch.Match @Header 200 {integer} X-Total-Count "the matches, not only the page: those read, and the notes after them that may match" @Failure 400 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 500 {object} respond.Failure @Router /api/searches [post]
Types ¶
This section is empty.