Command String Arguments
Valkey strings are stored in its simplest form: as a sequence of bytes. GLIDE offers GlideString which maps to Valkey strings. Use it to pass Valkey strings as arguments to commands, or receive Valkey strings in response to commands. GlideString represents either:
string: as a UTF-8 encoded string.Buffer: as abyte[].
The return types of command API:
- Command uses
stringinstead ofGlideStringas the return type if it contains a simple string value (simple strings in Valkey are always UTF-8 encoded strings). For example,typecommand returns one of pre-defined strings, orsetcommand which returns"OK". - Command uses
Bufferas the return type, because it always contains binary data. For example,dumpandfunctionDumpcommands. - Most commands use
GlideStringas the common return type.