The gpodder API served over a profile, so that apps such as AntennaPod, Kasts and gPodder sync with a server of the listener.
The server answers the paths of gpodder.net under /api/2. It's a device of podcast-clj, whose state holds what the apps send, with each entry written by the device of the app.
The listener has one list of subscriptions, as in the GPodder Sync app for Nextcloud. A change counts from the time that it arrived here, so that an action that a device sends late still reaches the other devices.
The gpodder API served over a profile, so that apps such as AntennaPod, Kasts and gPodder sync with a server of the listener. The server answers the paths of gpodder.net under /api/2. It's a device of podcast-clj, whose state holds what the apps send, with each entry written by the device of the app. The listener has one list of subscriptions, as in the GPodder Sync app for Nextcloud. A change counts from the time that it arrived here, so that an action that a device sends late still reaches the other devices.
(handler {:keys [state authorized-pred on-book-fn] sync! :sync :as opts})A Ring handler that serves the gpodder API over the profile in the
atom :state of opts, for one listener:
The book is plain data: when each change arrived here, the devices that registered, and the URLs that the apps named episodes by.
A request has Basic credentials or the session of a login, and the user in the path must be the one who logged in. A session lasts a day, and ends when the handler is made again, e.g. at a restart with a new password. Its cookie is Secure when the login came over https, by the scheme of the request or the X-Forwarded-Proto of a proxy. The calls run one at a time, as sync steps must, so :sync can be:
(stepper [backend])
A :sync gives a state, not a promise of one, so in ClojureScript, sync in the app and merge the result into the atom. The server merges what it writes with what the app put in the atom in between.
For a site with many listeners, make a handler for each, with a state, an :authorized-pred and a :sync of its own, and pass each request to the handler of the user in its path, each with a book of its own. Keep each handler while the site runs, since it holds the sessions.
A Ring handler that serves the gpodder API over the profile in the
atom :state of `opts`, for one listener:
- :state, the atom, e.g. (atom (profile/make "gpodder-server"))
- :authorized-pred, a function of a user and a password that says
whether to let them in, and everyone it lets in shares the one state
- :sync, a function of the state that brings it in step with the
listener's devices, before and after each call
- :identities-fn, as for gpodder/backend
- :feed-guid-fn, :feed-url-fn, :episode-id-fn and :episode-url-fn, each
way on its own, in place of :identities-fn
- :now-fn, a function of no arguments that gives the time, the clock by
default
- :max-bytes, the most that a request can send, 10 MB by default
- :allow-pred, a predicate of a feed URL that an app may subscribe to,
by default public-url?, so that the URLs that the server's own device
fetches are on the public internet
- :max-additions, the most subscriptions that one push can add, 1000 by
default, as a first sync of an app adds all of its own
- :book, the book that an earlier handler gave :on-book-fn, e.g. read
back at a restart, so that the apps don't get every change again
- :on-book-fn, a function of the book that the handler calls after a
call changed it, e.g. to save it
The book is plain data: when each change arrived here, the devices that
registered, and the URLs that the apps named episodes by.
A request has Basic credentials or the session of a login, and the user
in the path must be the one who logged in. A session lasts a day, and
ends when the handler is made again, e.g. at a restart with a new
password. Its cookie is Secure when the login came over https, by the
scheme of the request or the X-Forwarded-Proto of a proxy. The calls run
one at a time, as sync steps must, so :sync can be:
(stepper [backend])
A :sync gives a state, not a promise of one, so in ClojureScript, sync
in the app and merge the result into the atom. The server merges what
it writes with what the app put in the atom in between.
For a site with many listeners, make a handler for each, with a state,
an :authorized-pred and a :sync of its own, and pass each request to the
handler of the user in its path, each with a book of its own. Keep each
handler while the site runs, since it holds the sessions.(stepper backends)(stepper backends opts)A :sync for handler, which syncs a profile through backends with
opts, as like-minded/sync! does with profile/sync-options, and gives
the profile that results, in ClojureScript as a promise. It keeps the
cursors of each step for the next.
A :sync for handler, which syncs a profile through `backends` with `opts`, as like-minded/sync! does with profile/sync-options, and gives the profile that results, in ClojureScript as a promise. It keeps the cursors of each step for the next.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |