keyv.expire
0.000005

Sets a key to expire.

Arguments
bucketrequired
The bucket the key is stored under.
key
The key to set the expiration for.
ttl
How long the key should live, in seconds.
expiry
The unix timestamp when the key should expire, in seconds.
Return Value
true if the key was set to expire, otherwise false.
something went wrong :(
Setting a key to expire in 60 seconds
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.keyv.set.call(
  bucket: "c0781bbd", value: "foo"
)

client.keyv.expire.call(
  bucket: "c0781bbd", ttl: 60
)
client.keyv.set.call(
  undefined, c0781bbd
);

client.keyv.expiry.call(
  undefined, c0781bbd
);
curl "https://proc.run/keyv/set?bucket=c0781bbd" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "foo"

curl "https://proc.run/keyv/expire?bucket=c0781bbd&ttl=60" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
 

true


Stuck? Want to chat about an idea? Join the community on Discord.