Documentation
¶
Overview ¶
Package scriptlist is what the scripts listing is narrowed and ordered by.
It holds the query string half of GET /portal/scripts: the scope that decides which scripts a caller is asking about, the axes that narrow whatever that scope selected, and the ordering the store applies ahead of the page cap (#1795). It takes the caller as an address and a flag rather than as the HTTP layer's identity type, so it can be read and tested without the handler and cannot import it back.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter turns the query string into the listing's predicate and its ordering.
Two different things meet here and are kept apart. The SCOPE decides which scripts the caller is asking about -- their own by default, every script on request, and every script unconditionally for an administrator. The NARROWING axes (category and tag, #1369; free text, #1405; author, status and enabled, #1795) narrow whatever that scope selected, and apply to an administrator exactly as they do to everybody else, because they narrow what a reader asked for rather than what they are entitled to. Every one of them runs in the store, so each covers every script the scope admits rather than the page of them a listing happens to hold.
The ORDERING is carried through for the same reason: the store applies the page cap, so a column sorted anywhere else would sort the page.
A nil query names no axis, which is how a caller asks for the scope alone.
Types ¶
This section is empty.