How to use
First, import Redox on your Zig source file.
Initial Setup
Let's initialize an Redox instance.
Insert a New Record
Replaces the existing record if the key already exists.
Inserts the record only if the key already exists.
Inserts the record only if the key does not exist.
Insert a New Record with Ttl
Same as redox.set()
, with an additional time-to-live (TTL) value in seconds. The record is automatically deleted after this period.
Extract a Record by the Given Key
const rec = try redox.get("foo");
defer rec.free();
std.debug.print("Value: {s}|\n", .{rec.value()});
Delete a Record by the Given Key
Show Human-Readable Error Message
Shows the most recent error that occurred on the HiRedis instance.
Remarks: Currently, only the string data structure is supported, and only the synchronous interface is implemented.