SyntropyWeb.Api.Listing
(syntropy v0.3.0)
Copy Markdown
Shared helpers for paginated, filterable list endpoints.
List endpoints accept limit, cursor, q, and resource-specific filter
params. When persistence is enabled the controllers page through Postgres;
otherwise these helpers paginate the bounded in-memory rings with the same
opaque-cursor contract.
Summary
Functions
Filters agent exports by :perspective and :q (id, name, or perspective).
Filters in-memory recommendations by :status, :kind, and :q.
Filters in-memory run envelopes by :status, :kind, and :q.
Filters in-memory snapshots by :kind (trigger kind) and :q.
Builds the meta object appended to paginated list responses.
Applies cursor + limit pagination to an already-filtered in-memory list.
Parses shared list params (limit, cursor, plus the allowed filters).
Types
@type page() :: Syntropy.Persistence.page()
Functions
Filters agent exports by :perspective and :q (id, name, or perspective).
Filters in-memory recommendations by :status, :kind, and :q.
Filters in-memory run envelopes by :status, :kind, and :q.
Filters in-memory snapshots by :kind (trigger kind) and :q.
Builds the meta object appended to paginated list responses.
Applies cursor + limit pagination to an already-filtered in-memory list.
Entries must be sorted newest-first. timestamp_key selects the field used
for cursor ordering; the entry :id (a string) breaks ties.
Parses shared list params (limit, cursor, plus the allowed filters).
Returns {:error, :invalid_cursor} when a cursor is present but malformed.