No matching definitions.

tourist-session-valkey/store

src/tourist-session-valkey/store.tur

a Valkey-backed session Store.

Since: v0.1.0

defn

valkey-store-new

(valkey-store-new [^borrow client : Client prefix : cstr max-age : int] :)

a Valkey-backed Store.

clientborrowed Valkey client (caller owns its lifecycle)
prefixkey namespace, e.g. "sess"
max-agesession lifetime in seconds (match SessionConfig's max-age)

Store -- install it via session-mw, exactly like memory-store-new / file-store-new.

(let [c     (ok-val (client-connect "127.0.0.1" 6379))
        store (valkey-store-new c "sess" 86400)]
    (tourist 3000
      (session-mw store (default-session-config))
      ...))

Since: v0.1.0

Internal definitions
__vk-state-new
__vk-client
__vk-prefix
__vk-key-- malloc'd "<prefix>:<id>".
__itoa
__cstr-free
seq?
__finish-- free the reply a command result carries, when it has one.
vk-load-- GET <prefix>:<id>, decode the envelope, or 0 on miss.
vk-save-- SET the envelope then EXPIRE the key to the session lifetime.
vk-del-- DEL <prefix>:<id>.