No matching definitions.

session/file-store

src/session/file-store.tur

filesystem-backed session store.

Since: v0.1.0

defn

file-store-new

(file-store-new [dir : cstr] :)

create a filesystem-backed session Store.

dirdirectory for session files; created (mode 0700) if absent.

Store -- a vtable bound to `dir`.

(let [store (file-store-new "/var/lib/myapp/sessions")] ...)

Since: v0.1.0

Internal definitions
__file-read-- read <dir>/<id>.json into a malloc'd string, or NULL.
__file-remove-- unlink <dir>/<id>.json (used for lazy eviction).
__file-write-- atomically write `json` to <dir>/<id>.json (tmp + rename).
__now
__cstr-null?
__cstr-free
file-load-- read <dir>/<id>.json into a SessMap, or 0 (miss/expired).
file-save-- serialise a SessMap to <dir>/<id>.json (atomic rename).
file-del-- unlink <dir>/<id>.json.
__dir-state-- duplicate dir into an owned C string + ensure it exists.