Handles Redis string commands.
Each handler takes the uppercased command name, a list of string arguments, and an injected store map. Returns plain Elixir terms — the connection layer handles RESP encoding.
Supported commands
GET key— returns the value ornilSET key value [EX secs | PX ms | EXAT unix-sec | PXAT unix-ms] [NX | XX] [GET] [KEEPTTL]— sets a key with optional expiry/conditionsDEL key [key ...]— deletes keys, returns count deletedEXISTS key [key ...]— returns count of existing keysMGET key [key ...]— returns list of values (nil for missing)MSET key value [key value ...]— sets multiple keys atomicallyINCR key— increment integer value by 1DECR key— decrement integer value by 1INCRBY key increment— increment integer value by given amountDECRBY key decrement— decrement integer value by given amountINCRBYFLOAT key increment— increment float value by given amountAPPEND key value— append to value, return new lengthSTRLEN key— return byte length of valueGETSET key value— set key, return old valueGETDEL key— get value and delete atomicallyGETEX key [EX s | PX ms | EXAT ts | PXAT ms-ts | PERSIST]— get and update TTLSETNX key value— set if not existsSETEX key seconds value— set with expiry in secondsPSETEX key milliseconds value— set with expiry in millisecondsGETRANGE key start end— return substring by byte rangeSETRANGE key offset value— overwrite part of string at offsetMSETNX key value [key value ...]— set multiple only if none exist
Summary
Functions
Handles a string command.
Functions
Handles a string command.
Parameters
cmd- Uppercased command name (e.g."GET","SET")args- List of string argumentsstore- Injected store map withget,put,delete,exists?callbacks and atomic operations likeincr,append, etc.
Returns
Plain Elixir term: :ok, nil, integer, string, list, or {:error, message}.