Documentation
¶
Overview ¶
Package keyttl applies the TTL of a pulse Redis key inside the Lua script that writes the key, so the write and its expiry are one atomic step.
A fixed TTL is set only when the key has no TTL, the semantics of `EXPIRE key seconds NX`. A sliding TTL is reset by every write.
Index ¶
Constants ¶
const LuaApply = `` /* 257-byte string literal not displayed */
LuaApply is Lua source that defines the local function apply_ttl(key, seconds, sliding). Prepend it to a script. The function sets the TTL of key to seconds when seconds is positive and either sliding is "1" or key has no TTL. It does nothing when key does not exist. Pass seconds and sliding as script arguments built by Args.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.