(assoc-if-exists m k v)
Assocs k with value v to map m only if there is already k associated.
Assocs k with value v to map m only if there is already k associated.
(assoc-if-not-exists m k v)
Assocs k to store with value v only if no k was associated before.
Assocs k to store with value v only if no k was associated before.
(coll->str coll)
Serializes collection of strings into single (space-separated) string.
Serializes collection of strings into single (space-separated) string.
(digest secret)
Applies SHA-256 on given token
Applies SHA-256 on given token
(expired? item)
Returns true if given item (more specifically its :expires-at value) is expired or falsey otherwise. Item with no expires-at is non-expirable.
Returns true if given item (more specifically its :expires-at value) is expired or falsey otherwise. Item with no expires-at is non-expirable.
(expires->ttl expires-at)
Returns number of seconds between now and expires-at.
Returns number of seconds between now and expires-at.
(generate-secret)
Generates a unique secret code.
Generates a unique secret code.
(init-periodic f interval)
Schedules a function f to be run periodically at given interval. Function gets {:date now} as an argument.
Schedules a function f to be run periodically at given interval. Function gets {:date now} as an argument.
(reset-ttl item ttl)
Extends time to live of given item by ttl seconds.
Extends time to live of given item by ttl seconds.
(stop-periodic store)
Stops periodically run funciton attached to store.
Stops periodically run funciton attached to store.
(str->coll coll str)
Decomposes string into collection of space separated substrings. Returns given collection if string was either null or empty.
Decomposes string into collection of space separated substrings. Returns given collection if string was either null or empty.
(with-periodic-fn store f interval)
Initializes periodically run function and associates it to given store.
Initializes periodically run function and associates it to given store.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close