use crate::types::RespCommand;
pub(crate) const FIRST_DATA_COMMAND: RespCommand = RespCommand::Append;
pub(crate) const LAST_DATA_COMMAND: RespCommand = RespCommand::Evalsha;
pub(crate) const LAST_VALID_COMMAND: RespCommand = RespCommand::Quit;
pub(crate) fn resp_command_from_cs_name(name: &str) -> Option<RespCommand> {
let upper = name.to_ascii_uppercase();
match upper.as_str() {
"NONE" => Some(RespCommand::None),
"APPEND" => Some(RespCommand::Append),
"BITFIELD" => Some(RespCommand::Bitfield),
"BZMPOP" => Some(RespCommand::Bzmpop),
"BZPOPMAX" => Some(RespCommand::Bzpopmax),
"BZPOPMIN" => Some(RespCommand::Bzpopmin),
"DECR" => Some(RespCommand::Decr),
"DECRBY" => Some(RespCommand::Decrby),
"DEL" => Some(RespCommand::Del),
"DELIFEXPIM" => Some(RespCommand::Delifexpim),
"DELIFGREATER" => Some(RespCommand::Delifgreater),
"EXPIRE" => Some(RespCommand::Expire),
"EXPIREAT" => Some(RespCommand::Expireat),
"FLUSHALL" => Some(RespCommand::Flushall),
"FLUSHDB" => Some(RespCommand::Flushdb),
"GEOADD" => Some(RespCommand::Geoadd),
"GEORADIUS" => Some(RespCommand::Georadius),
"GEORADIUSBYMEMBER" => Some(RespCommand::Georadiusbymember),
"GEOSEARCHSTORE" => Some(RespCommand::Geosearchstore),
"GETDEL" => Some(RespCommand::Getdel),
"GETEX" => Some(RespCommand::Getex),
"GETSET" => Some(RespCommand::Getset),
"HCOLLECT" => Some(RespCommand::Hcollect),
"HDEL" => Some(RespCommand::Hdel),
"HEXPIRE" => Some(RespCommand::Hexpire),
"HPEXPIRE" => Some(RespCommand::Hpexpire),
"HEXPIREAT" => Some(RespCommand::Hexpireat),
"HPEXPIREAT" => Some(RespCommand::Hpexpireat),
"HPERSIST" => Some(RespCommand::Hpersist),
"HINCRBY" => Some(RespCommand::Hincrby),
"HINCRBYFLOAT" => Some(RespCommand::Hincrbyfloat),
"HMSET" => Some(RespCommand::Hmset),
"HSET" => Some(RespCommand::Hset),
"HSETNX" => Some(RespCommand::Hsetnx),
"INCR" => Some(RespCommand::Incr),
"INCRBY" => Some(RespCommand::Incrby),
"INCRBYFLOAT" => Some(RespCommand::Incrbyfloat),
"LINSERT" => Some(RespCommand::Linsert),
"LMOVE" => Some(RespCommand::Lmove),
"LMPOP" => Some(RespCommand::Lmpop),
"LPOP" => Some(RespCommand::Lpop),
"LPUSH" => Some(RespCommand::Lpush),
"LPUSHX" => Some(RespCommand::Lpushx),
"LREM" => Some(RespCommand::Lrem),
"LSET" => Some(RespCommand::Lset),
"LTRIM" => Some(RespCommand::Ltrim),
"BLPOP" => Some(RespCommand::Blpop),
"BRPOP" => Some(RespCommand::Brpop),
"BLMOVE" => Some(RespCommand::Blmove),
"BRPOPLPUSH" => Some(RespCommand::Brpoplpush),
"BLMPOP" => Some(RespCommand::Blmpop),
"MIGRATE" => Some(RespCommand::Migrate),
"MSET" => Some(RespCommand::Mset),
"MSETNX" => Some(RespCommand::Msetnx),
"PERSIST" => Some(RespCommand::Persist),
"PEXPIRE" => Some(RespCommand::Pexpire),
"PEXPIREAT" => Some(RespCommand::Pexpireat),
"PFADD" => Some(RespCommand::Pfadd),
"PFMERGE" => Some(RespCommand::Pfmerge),
"PSETEX" => Some(RespCommand::Psetex),
"RENAME" => Some(RespCommand::Rename),
"RICREATE" => Some(RespCommand::Ricreate),
"RIDEL" => Some(RespCommand::Ridel),
"RIPROMOTE" => Some(RespCommand::Ripromote),
"RIRESTORE" => Some(RespCommand::Rirestore),
"RISET" => Some(RespCommand::Riset),
"RESTORE" => Some(RespCommand::Restore),
"RENAMENX" => Some(RespCommand::Renamenx),
"RPOP" => Some(RespCommand::Rpop),
"RPOPLPUSH" => Some(RespCommand::Rpoplpush),
"RPUSH" => Some(RespCommand::Rpush),
"RPUSHX" => Some(RespCommand::Rpushx),
"SADD" => Some(RespCommand::Sadd),
"SDIFFSTORE" => Some(RespCommand::Sdiffstore),
"SET" => Some(RespCommand::Set),
"SETBIT" => Some(RespCommand::Setbit),
"SETEX" => Some(RespCommand::Setex),
"SETEXNX" => Some(RespCommand::Setexnx),
"SETEXXX" => Some(RespCommand::Setexxx),
"SETNX" => Some(RespCommand::Setnx),
"SETIFMATCH" => Some(RespCommand::Setifmatch),
"SETIFGREATER" => Some(RespCommand::Setifgreater),
"SETWITHETAG" => Some(RespCommand::Setwithetag),
"SETKEEPTTL" => Some(RespCommand::Setkeepttl),
"SETKEEPTTLXX" => Some(RespCommand::Setkeepttlxx),
"SETRANGE" => Some(RespCommand::Setrange),
"SINTERSTORE" => Some(RespCommand::Sinterstore),
"SMOVE" => Some(RespCommand::Smove),
"SPOP" => Some(RespCommand::Spop),
"SREM" => Some(RespCommand::Srem),
"SUNIONSTORE" => Some(RespCommand::Sunionstore),
"SWAPDB" => Some(RespCommand::Swapdb),
"UNLINK" => Some(RespCommand::Unlink),
"VADD" => Some(RespCommand::Vadd),
"VREM" => Some(RespCommand::Vrem),
"VSETATTR" => Some(RespCommand::Vsetattr),
"ZADD" => Some(RespCommand::Zadd),
"ZCOLLECT" => Some(RespCommand::Zcollect),
"ZDIFFSTORE" => Some(RespCommand::Zdiffstore),
"ZEXPIRE" => Some(RespCommand::Zexpire),
"ZPEXPIRE" => Some(RespCommand::Zpexpire),
"ZEXPIREAT" => Some(RespCommand::Zexpireat),
"ZPEXPIREAT" => Some(RespCommand::Zpexpireat),
"ZPERSIST" => Some(RespCommand::Zpersist),
"ZINCRBY" => Some(RespCommand::Zincrby),
"ZMPOP" => Some(RespCommand::Zmpop),
"ZINTERSTORE" => Some(RespCommand::Zinterstore),
"ZPOPMAX" => Some(RespCommand::Zpopmax),
"ZPOPMIN" => Some(RespCommand::Zpopmin),
"ZRANGESTORE" => Some(RespCommand::Zrangestore),
"ZREM" => Some(RespCommand::Zrem),
"ZREMRANGEBYLEX" => Some(RespCommand::Zremrangebylex),
"ZREMRANGEBYRANK" => Some(RespCommand::Zremrangebyrank),
"ZREMRANGEBYSCORE" => Some(RespCommand::Zremrangebyscore),
"ZUNIONSTORE" => Some(RespCommand::Zunionstore),
"BITOP" => Some(RespCommand::Bitop),
"BITOP_AND" => Some(RespCommand::BitopAnd),
"BITOP_OR" => Some(RespCommand::BitopOr),
"BITOP_XOR" => Some(RespCommand::BitopXor),
"BITOP_NOT" => Some(RespCommand::BitopNot),
"BITOP_DIFF" => Some(RespCommand::BitopDiff),
"BITCOUNT" => Some(RespCommand::Bitcount),
"BITFIELD_RO" => Some(RespCommand::BitfieldRo),
"BITPOS" => Some(RespCommand::Bitpos),
"COSCAN" => Some(RespCommand::Coscan),
"DBSIZE" => Some(RespCommand::Dbsize),
"DUMP" => Some(RespCommand::Dump),
"EXISTS" => Some(RespCommand::Exists),
"EXPIRETIME" => Some(RespCommand::Expiretime),
"GEODIST" => Some(RespCommand::Geodist),
"GEOHASH" => Some(RespCommand::Geohash),
"GEOPOS" => Some(RespCommand::Geopos),
"GEORADIUS_RO" => Some(RespCommand::GeoradiusRo),
"GEORADIUSBYMEMBER_RO" => Some(RespCommand::GeoradiusbymemberRo),
"GEOSEARCH" => Some(RespCommand::Geosearch),
"GET" => Some(RespCommand::Get),
"GETBIT" => Some(RespCommand::Getbit),
"GETIFNOTMATCH" => Some(RespCommand::Getifnotmatch),
"GETRANGE" => Some(RespCommand::Getrange),
"GETWITHETAG" => Some(RespCommand::Getwithetag),
"HEXISTS" => Some(RespCommand::Hexists),
"HGET" => Some(RespCommand::Hget),
"HGETALL" => Some(RespCommand::Hgetall),
"HKEYS" => Some(RespCommand::Hkeys),
"HLEN" => Some(RespCommand::Hlen),
"HMGET" => Some(RespCommand::Hmget),
"HRANDFIELD" => Some(RespCommand::Hrandfield),
"HSCAN" => Some(RespCommand::Hscan),
"HSTRLEN" => Some(RespCommand::Hstrlen),
"HVALS" => Some(RespCommand::Hvals),
"KEYS" => Some(RespCommand::Keys),
"LCS" => Some(RespCommand::Lcs),
"HTTL" => Some(RespCommand::Httl),
"HPTTL" => Some(RespCommand::Hpttl),
"HEXPIRETIME" => Some(RespCommand::Hexpiretime),
"HPEXPIRETIME" => Some(RespCommand::Hpexpiretime),
"LINDEX" => Some(RespCommand::Lindex),
"LLEN" => Some(RespCommand::Llen),
"LPOS" => Some(RespCommand::Lpos),
"LRANGE" => Some(RespCommand::Lrange),
"MEMORY_USAGE" => Some(RespCommand::MemoryUsage),
"MGET" => Some(RespCommand::Mget),
"OBJECT_ENCODING" => Some(RespCommand::ObjectEncoding),
"OBJECT_FREQ" => Some(RespCommand::ObjectFreq),
"OBJECT_IDLETIME" => Some(RespCommand::ObjectIdletime),
"OBJECT_REFCOUNT" => Some(RespCommand::ObjectRefcount),
"PEXPIRETIME" => Some(RespCommand::Pexpiretime),
"PFCOUNT" => Some(RespCommand::Pfcount),
"PTTL" => Some(RespCommand::Pttl),
"SCAN" => Some(RespCommand::Scan),
"SCARD" => Some(RespCommand::Scard),
"SDIFF" => Some(RespCommand::Sdiff),
"SINTER" => Some(RespCommand::Sinter),
"SINTERCARD" => Some(RespCommand::Sintercard),
"SISMEMBER" => Some(RespCommand::Sismember),
"SMEMBERS" => Some(RespCommand::Smembers),
"SMISMEMBER" => Some(RespCommand::Smismember),
"SPUBLISH" => Some(RespCommand::Spublish),
"SRANDMEMBER" => Some(RespCommand::Srandmember),
"SSCAN" => Some(RespCommand::Sscan),
"SSUBSCRIBE" => Some(RespCommand::Ssubscribe),
"STRLEN" => Some(RespCommand::Strlen),
"SUBSTR" => Some(RespCommand::Substr),
"SUNION" => Some(RespCommand::Sunion),
"TTL" => Some(RespCommand::Ttl),
"TYPE" => Some(RespCommand::Type),
"VCARD" => Some(RespCommand::Vcard),
"VDIM" => Some(RespCommand::Vdim),
"VEMB" => Some(RespCommand::Vemb),
"VGETATTR" => Some(RespCommand::Vgetattr),
"VINFO" => Some(RespCommand::Vinfo),
"VISMEMBER" => Some(RespCommand::Vismember),
"VLINKS" => Some(RespCommand::Vlinks),
"VRANDMEMBER" => Some(RespCommand::Vrandmember),
"VSIM" => Some(RespCommand::Vsim),
"WATCH" => Some(RespCommand::Watch),
"WATCHMS" => Some(RespCommand::Watchms),
"WATCHOS" => Some(RespCommand::Watchos),
"ZCARD" => Some(RespCommand::Zcard),
"ZCOUNT" => Some(RespCommand::Zcount),
"ZDIFF" => Some(RespCommand::Zdiff),
"ZINTER" => Some(RespCommand::Zinter),
"ZINTERCARD" => Some(RespCommand::Zintercard),
"ZLEXCOUNT" => Some(RespCommand::Zlexcount),
"ZMSCORE" => Some(RespCommand::Zmscore),
"ZRANDMEMBER" => Some(RespCommand::Zrandmember),
"ZRANGE" => Some(RespCommand::Zrange),
"ZRANGEBYLEX" => Some(RespCommand::Zrangebylex),
"ZRANGEBYSCORE" => Some(RespCommand::Zrangebyscore),
"ZRANK" => Some(RespCommand::Zrank),
"ZREVRANGE" => Some(RespCommand::Zrevrange),
"ZREVRANGEBYLEX" => Some(RespCommand::Zrevrangebylex),
"ZREVRANGEBYSCORE" => Some(RespCommand::Zrevrangebyscore),
"ZREVRANK" => Some(RespCommand::Zrevrank),
"ZTTL" => Some(RespCommand::Zttl),
"ZPTTL" => Some(RespCommand::Zpttl),
"ZEXPIRETIME" => Some(RespCommand::Zexpiretime),
"ZPEXPIRETIME" => Some(RespCommand::Zpexpiretime),
"ZSCAN" => Some(RespCommand::Zscan),
"ZSCORE" => Some(RespCommand::Zscore),
"ZUNION" => Some(RespCommand::Zunion),
"RICONFIG" => Some(RespCommand::Riconfig),
"RIEXISTS" => Some(RespCommand::Riexists),
"RIGET" => Some(RespCommand::Riget),
"RIMETRICS" => Some(RespCommand::Rimetrics),
"RIRANGE" => Some(RespCommand::Rirange),
"RISCAN" => Some(RespCommand::Riscan),
"EVAL" => Some(RespCommand::Eval),
"EVALSHA" => Some(RespCommand::Evalsha),
"ASYNC" => Some(RespCommand::Async),
"PING" => Some(RespCommand::Ping),
"PUBSUB" => Some(RespCommand::Pubsub),
"PUBSUB_CHANNELS" => Some(RespCommand::PubsubChannels),
"PUBSUB_NUMPAT" => Some(RespCommand::PubsubNumpat),
"PUBSUB_NUMSUB" => Some(RespCommand::PubsubNumsub),
"PUBLISH" => Some(RespCommand::Publish),
"SUBSCRIBE" => Some(RespCommand::Subscribe),
"PSUBSCRIBE" => Some(RespCommand::Psubscribe),
"UNSUBSCRIBE" => Some(RespCommand::Unsubscribe),
"PUNSUBSCRIBE" => Some(RespCommand::Punsubscribe),
"ASKING" => Some(RespCommand::Asking),
"SELECT" => Some(RespCommand::Select),
"ECHO" => Some(RespCommand::Echo),
"CLIENT" => Some(RespCommand::Client),
"CLIENT_ID" => Some(RespCommand::ClientId),
"CLIENT_INFO" => Some(RespCommand::ClientInfo),
"CLIENT_LIST" => Some(RespCommand::ClientList),
"CLIENT_KILL" => Some(RespCommand::ClientKill),
"CLIENT_GETNAME" => Some(RespCommand::ClientGetname),
"CLIENT_SETNAME" => Some(RespCommand::ClientSetname),
"CLIENT_SETINFO" => Some(RespCommand::ClientSetinfo),
"CLIENT_UNBLOCK" => Some(RespCommand::ClientUnblock),
"MONITOR" => Some(RespCommand::Monitor),
"MODULE" => Some(RespCommand::Module),
"MODULE_LOADCS" => Some(RespCommand::ModuleLoadcs),
"REGISTERCS" => Some(RespCommand::Registercs),
"MULTI" => Some(RespCommand::Multi),
"EXEC" => Some(RespCommand::Exec),
"DISCARD" => Some(RespCommand::Discard),
"UNWATCH" => Some(RespCommand::Unwatch),
"RUNTXP" => Some(RespCommand::Runtxp),
"READONLY" => Some(RespCommand::Readonly),
"READWRITE" => Some(RespCommand::Readwrite),
"REPLICAOF" => Some(RespCommand::Replicaof),
"SECONDARYOF" => Some(RespCommand::Secondaryof),
"INFO" => Some(RespCommand::Info),
"TIME" => Some(RespCommand::Time),
"ROLE" => Some(RespCommand::Role),
"SAVE" => Some(RespCommand::Save),
"EXPDELSCAN" => Some(RespCommand::Expdelscan),
"LASTSAVE" => Some(RespCommand::Lastsave),
"BGSAVE" => Some(RespCommand::Bgsave),
"COMMITAOF" => Some(RespCommand::Commitaof),
"FAILOVER" => Some(RespCommand::Failover),
"CUSTOMTXN" => Some(RespCommand::Customtxn),
"CUSTOMRAWSTRINGCMD" => Some(RespCommand::Customrawstringcmd),
"CUSTOMOBJCMD" => Some(RespCommand::Customobjcmd),
"CUSTOMPROCEDURE" => Some(RespCommand::Customprocedure),
"SCRIPT" => Some(RespCommand::Script),
"SCRIPT_EXISTS" => Some(RespCommand::ScriptExists),
"SCRIPT_FLUSH" => Some(RespCommand::ScriptFlush),
"SCRIPT_LOAD" => Some(RespCommand::ScriptLoad),
"ACL" => Some(RespCommand::Acl),
"ACL_CAT" => Some(RespCommand::AclCat),
"ACL_DELUSER" => Some(RespCommand::AclDeluser),
"ACL_GENPASS" => Some(RespCommand::AclGenpass),
"ACL_GETUSER" => Some(RespCommand::AclGetuser),
"ACL_LIST" => Some(RespCommand::AclList),
"ACL_LOAD" => Some(RespCommand::AclLoad),
"ACL_SAVE" => Some(RespCommand::AclSave),
"ACL_SETUSER" => Some(RespCommand::AclSetuser),
"ACL_USERS" => Some(RespCommand::AclUsers),
"ACL_WHOAMI" => Some(RespCommand::AclWhoami),
"COMMAND" => Some(RespCommand::Command),
"COMMAND_COUNT" => Some(RespCommand::CommandCount),
"COMMAND_DOCS" => Some(RespCommand::CommandDocs),
"COMMAND_INFO" => Some(RespCommand::CommandInfo),
"COMMAND_GETKEYS" => Some(RespCommand::CommandGetkeys),
"COMMAND_GETKEYSANDFLAGS" => Some(RespCommand::CommandGetkeysandflags),
"MEMORY" => Some(RespCommand::Memory),
"OBJECT" => Some(RespCommand::Object),
"OBJECT_HELP" => Some(RespCommand::ObjectHelp),
"CONFIG" => Some(RespCommand::Config),
"CONFIG_GET" => Some(RespCommand::ConfigGet),
"CONFIG_REWRITE" => Some(RespCommand::ConfigRewrite),
"CONFIG_SET" => Some(RespCommand::ConfigSet),
"DEBUG" => Some(RespCommand::Debug),
"LATENCY" => Some(RespCommand::Latency),
"LATENCY_HELP" => Some(RespCommand::LatencyHelp),
"LATENCY_HISTOGRAM" => Some(RespCommand::LatencyHistogram),
"LATENCY_RESET" => Some(RespCommand::LatencyReset),
"SLOWLOG" => Some(RespCommand::Slowlog),
"SLOWLOG_HELP" => Some(RespCommand::SlowlogHelp),
"SLOWLOG_LEN" => Some(RespCommand::SlowlogLen),
"SLOWLOG_GET" => Some(RespCommand::SlowlogGet),
"SLOWLOG_RESET" => Some(RespCommand::SlowlogReset),
"CLUSTER" => Some(RespCommand::Cluster),
"CLUSTER_ADDSLOTS" => Some(RespCommand::ClusterAddslots),
"CLUSTER_ADDSLOTSRANGE" => Some(RespCommand::ClusterAddslotsrange),
"CLUSTER_ADVANCE_TIME" => Some(RespCommand::ClusterAdvanceTime),
"CLUSTER_APPENDLOG" => Some(RespCommand::ClusterAppendlog),
"CLUSTER_ATTACH_SYNC" => Some(RespCommand::ClusterAttachSync),
"CLUSTER_BANLIST" => Some(RespCommand::ClusterBanlist),
"CLUSTER_BEGIN_REPLICA_RECOVER" => Some(RespCommand::ClusterBeginReplicaRecover),
"CLUSTER_BUMPEPOCH" => Some(RespCommand::ClusterBumpepoch),
"CLUSTER_COUNTKEYSINSLOT" => Some(RespCommand::ClusterCountkeysinslot),
"CLUSTER_DELKEYSINSLOT" => Some(RespCommand::ClusterDelkeysinslot),
"CLUSTER_DELKEYSINSLOTRANGE" => Some(RespCommand::ClusterDelkeysinslotrange),
"CLUSTER_DELSLOTS" => Some(RespCommand::ClusterDelslots),
"CLUSTER_DELSLOTSRANGE" => Some(RespCommand::ClusterDelslotsrange),
"CLUSTER_ENDPOINT" => Some(RespCommand::ClusterEndpoint),
"CLUSTER_FAILOVER" => Some(RespCommand::ClusterFailover),
"CLUSTER_FAILREPLICATIONOFFSET" => Some(RespCommand::ClusterFailreplicationoffset),
"CLUSTER_FAILSTOPWRITES" => Some(RespCommand::ClusterFailstopwrites),
"CLUSTER_FLUSHALL" => Some(RespCommand::ClusterFlushall),
"CLUSTER_FORGET" => Some(RespCommand::ClusterForget),
"CLUSTER_GETKEYSINSLOT" => Some(RespCommand::ClusterGetkeysinslot),
"CLUSTER_GOSSIP" => Some(RespCommand::ClusterGossip),
"CLUSTER_HELP" => Some(RespCommand::ClusterHelp),
"CLUSTER_INFO" => Some(RespCommand::ClusterInfo),
"CLUSTER_INITIATE_REPLICA_SYNC" => Some(RespCommand::ClusterInitiateReplicaSync),
"CLUSTER_KEYSLOT" => Some(RespCommand::ClusterKeyslot),
"CLUSTER_MEET" => Some(RespCommand::ClusterMeet),
"CLUSTER_MIGRATE" => Some(RespCommand::ClusterMigrate),
"CLUSTER_MLOG_KEY_TIME" => Some(RespCommand::ClusterMlogKeyTime),
"CLUSTER_MTASKS" => Some(RespCommand::ClusterMtasks),
"CLUSTER_MYID" => Some(RespCommand::ClusterMyid),
"CLUSTER_MYPARENTID" => Some(RespCommand::ClusterMyparentid),
"CLUSTER_NODES" => Some(RespCommand::ClusterNodes),
"CLUSTER_PUBLISH" => Some(RespCommand::ClusterPublish),
"CLUSTER_SPUBLISH" => Some(RespCommand::ClusterSpublish),
"CLUSTER_REPLICAS" => Some(RespCommand::ClusterReplicas),
"CLUSTER_REPLICATE" => Some(RespCommand::ClusterReplicate),
"CLUSTER_RESERVE" => Some(RespCommand::ClusterReserve),
"CLUSTER_RESET" => Some(RespCommand::ClusterReset),
"CLUSTER_SEND_CKPT_FILE_SEGMENT" => Some(RespCommand::ClusterSendCkptFileSegment),
"CLUSTER_SEND_CKPT_METADATA" => Some(RespCommand::ClusterSendCkptMetadata),
"CLUSTER_SETCONFIGEPOCH" => Some(RespCommand::ClusterSetconfigepoch),
"CLUSTER_SETSLOT" => Some(RespCommand::ClusterSetslot),
"CLUSTER_SETSLOTSRANGE" => Some(RespCommand::ClusterSetslotsrange),
"CLUSTER_SHARDS" => Some(RespCommand::ClusterShards),
"CLUSTER_SLOTS" => Some(RespCommand::ClusterSlots),
"CLUSTER_SLOTSTATE" => Some(RespCommand::ClusterSlotstate),
"CLUSTER_SNAPSHOT_DATA" => Some(RespCommand::ClusterSnapshotData),
"CLUSTER_SYNC" => Some(RespCommand::ClusterSync),
"AUTH" => Some(RespCommand::Auth),
"HELLO" => Some(RespCommand::Hello),
"QUIT" => Some(RespCommand::Quit),
"INVALID" => Some(RespCommand::Invalid),
_ => None,
}
}
pub(crate) fn resp_command_to_cs_name(cmd: RespCommand) -> &'static str {
match cmd {
RespCommand::None => "NONE",
RespCommand::Append => "APPEND",
RespCommand::Bitfield => "BITFIELD",
RespCommand::Bzmpop => "BZMPOP",
RespCommand::Bzpopmax => "BZPOPMAX",
RespCommand::Bzpopmin => "BZPOPMIN",
RespCommand::Decr => "DECR",
RespCommand::Decrby => "DECRBY",
RespCommand::Del => "DEL",
RespCommand::Delifexpim => "DELIFEXPIM",
RespCommand::Delifgreater => "DELIFGREATER",
RespCommand::Expire => "EXPIRE",
RespCommand::Expireat => "EXPIREAT",
RespCommand::Flushall => "FLUSHALL",
RespCommand::Flushdb => "FLUSHDB",
RespCommand::Geoadd => "GEOADD",
RespCommand::Georadius => "GEORADIUS",
RespCommand::Georadiusbymember => "GEORADIUSBYMEMBER",
RespCommand::Geosearchstore => "GEOSEARCHSTORE",
RespCommand::Getdel => "GETDEL",
RespCommand::Getex => "GETEX",
RespCommand::Getset => "GETSET",
RespCommand::Hcollect => "HCOLLECT",
RespCommand::Hdel => "HDEL",
RespCommand::Hexpire => "HEXPIRE",
RespCommand::Hpexpire => "HPEXPIRE",
RespCommand::Hexpireat => "HEXPIREAT",
RespCommand::Hpexpireat => "HPEXPIREAT",
RespCommand::Hpersist => "HPERSIST",
RespCommand::Hincrby => "HINCRBY",
RespCommand::Hincrbyfloat => "HINCRBYFLOAT",
RespCommand::Hmset => "HMSET",
RespCommand::Hset => "HSET",
RespCommand::Hsetnx => "HSETNX",
RespCommand::Incr => "INCR",
RespCommand::Incrby => "INCRBY",
RespCommand::Incrbyfloat => "INCRBYFLOAT",
RespCommand::Linsert => "LINSERT",
RespCommand::Lmove => "LMOVE",
RespCommand::Lmpop => "LMPOP",
RespCommand::Lpop => "LPOP",
RespCommand::Lpush => "LPUSH",
RespCommand::Lpushx => "LPUSHX",
RespCommand::Lrem => "LREM",
RespCommand::Lset => "LSET",
RespCommand::Ltrim => "LTRIM",
RespCommand::Blpop => "BLPOP",
RespCommand::Brpop => "BRPOP",
RespCommand::Blmove => "BLMOVE",
RespCommand::Brpoplpush => "BRPOPLPUSH",
RespCommand::Blmpop => "BLMPOP",
RespCommand::Migrate => "MIGRATE",
RespCommand::Mset => "MSET",
RespCommand::Msetnx => "MSETNX",
RespCommand::Persist => "PERSIST",
RespCommand::Pexpire => "PEXPIRE",
RespCommand::Pexpireat => "PEXPIREAT",
RespCommand::Pfadd => "PFADD",
RespCommand::Pfmerge => "PFMERGE",
RespCommand::Psetex => "PSETEX",
RespCommand::Rename => "RENAME",
RespCommand::Ricreate => "RICREATE",
RespCommand::Ridel => "RIDEL",
RespCommand::Ripromote => "RIPROMOTE",
RespCommand::Rirestore => "RIRESTORE",
RespCommand::Riset => "RISET",
RespCommand::Restore => "RESTORE",
RespCommand::Renamenx => "RENAMENX",
RespCommand::Rpop => "RPOP",
RespCommand::Rpoplpush => "RPOPLPUSH",
RespCommand::Rpush => "RPUSH",
RespCommand::Rpushx => "RPUSHX",
RespCommand::Sadd => "SADD",
RespCommand::Sdiffstore => "SDIFFSTORE",
RespCommand::Set => "SET",
RespCommand::Setbit => "SETBIT",
RespCommand::Setex => "SETEX",
RespCommand::Setexnx => "SETEXNX",
RespCommand::Setexxx => "SETEXXX",
RespCommand::Setnx => "SETNX",
RespCommand::Setifmatch => "SETIFMATCH",
RespCommand::Setifgreater => "SETIFGREATER",
RespCommand::Setwithetag => "SETWITHETAG",
RespCommand::Setkeepttl => "SETKEEPTTL",
RespCommand::Setkeepttlxx => "SETKEEPTTLXX",
RespCommand::Setrange => "SETRANGE",
RespCommand::Sinterstore => "SINTERSTORE",
RespCommand::Smove => "SMOVE",
RespCommand::Spop => "SPOP",
RespCommand::Srem => "SREM",
RespCommand::Sunionstore => "SUNIONSTORE",
RespCommand::Swapdb => "SWAPDB",
RespCommand::Unlink => "UNLINK",
RespCommand::Vadd => "VADD",
RespCommand::Vrem => "VREM",
RespCommand::Vsetattr => "VSETATTR",
RespCommand::Zadd => "ZADD",
RespCommand::Zcollect => "ZCOLLECT",
RespCommand::Zdiffstore => "ZDIFFSTORE",
RespCommand::Zexpire => "ZEXPIRE",
RespCommand::Zpexpire => "ZPEXPIRE",
RespCommand::Zexpireat => "ZEXPIREAT",
RespCommand::Zpexpireat => "ZPEXPIREAT",
RespCommand::Zpersist => "ZPERSIST",
RespCommand::Zincrby => "ZINCRBY",
RespCommand::Zmpop => "ZMPOP",
RespCommand::Zinterstore => "ZINTERSTORE",
RespCommand::Zpopmax => "ZPOPMAX",
RespCommand::Zpopmin => "ZPOPMIN",
RespCommand::Zrangestore => "ZRANGESTORE",
RespCommand::Zrem => "ZREM",
RespCommand::Zremrangebylex => "ZREMRANGEBYLEX",
RespCommand::Zremrangebyrank => "ZREMRANGEBYRANK",
RespCommand::Zremrangebyscore => "ZREMRANGEBYSCORE",
RespCommand::Zunionstore => "ZUNIONSTORE",
RespCommand::Bitop => "BITOP",
RespCommand::BitopAnd => "BITOP_AND",
RespCommand::BitopOr => "BITOP_OR",
RespCommand::BitopXor => "BITOP_XOR",
RespCommand::BitopNot => "BITOP_NOT",
RespCommand::BitopDiff => "BITOP_DIFF",
RespCommand::Bitcount => "BITCOUNT",
RespCommand::BitfieldRo => "BITFIELD_RO",
RespCommand::Bitpos => "BITPOS",
RespCommand::Coscan => "COSCAN",
RespCommand::Dbsize => "DBSIZE",
RespCommand::Dump => "DUMP",
RespCommand::Exists => "EXISTS",
RespCommand::Expiretime => "EXPIRETIME",
RespCommand::Geodist => "GEODIST",
RespCommand::Geohash => "GEOHASH",
RespCommand::Geopos => "GEOPOS",
RespCommand::GeoradiusRo => "GEORADIUS_RO",
RespCommand::GeoradiusbymemberRo => "GEORADIUSBYMEMBER_RO",
RespCommand::Geosearch => "GEOSEARCH",
RespCommand::Get => "GET",
RespCommand::Getbit => "GETBIT",
RespCommand::Getifnotmatch => "GETIFNOTMATCH",
RespCommand::Getrange => "GETRANGE",
RespCommand::Getwithetag => "GETWITHETAG",
RespCommand::Hexists => "HEXISTS",
RespCommand::Hget => "HGET",
RespCommand::Hgetall => "HGETALL",
RespCommand::Hkeys => "HKEYS",
RespCommand::Hlen => "HLEN",
RespCommand::Hmget => "HMGET",
RespCommand::Hrandfield => "HRANDFIELD",
RespCommand::Hscan => "HSCAN",
RespCommand::Hstrlen => "HSTRLEN",
RespCommand::Hvals => "HVALS",
RespCommand::Keys => "KEYS",
RespCommand::Lcs => "LCS",
RespCommand::Httl => "HTTL",
RespCommand::Hpttl => "HPTTL",
RespCommand::Hexpiretime => "HEXPIRETIME",
RespCommand::Hpexpiretime => "HPEXPIRETIME",
RespCommand::Lindex => "LINDEX",
RespCommand::Llen => "LLEN",
RespCommand::Lpos => "LPOS",
RespCommand::Lrange => "LRANGE",
RespCommand::MemoryUsage => "MEMORY_USAGE",
RespCommand::Mget => "MGET",
RespCommand::ObjectEncoding => "OBJECT_ENCODING",
RespCommand::ObjectFreq => "OBJECT_FREQ",
RespCommand::ObjectIdletime => "OBJECT_IDLETIME",
RespCommand::ObjectRefcount => "OBJECT_REFCOUNT",
RespCommand::Pexpiretime => "PEXPIRETIME",
RespCommand::Pfcount => "PFCOUNT",
RespCommand::Pttl => "PTTL",
RespCommand::Scan => "SCAN",
RespCommand::Scard => "SCARD",
RespCommand::Sdiff => "SDIFF",
RespCommand::Sinter => "SINTER",
RespCommand::Sintercard => "SINTERCARD",
RespCommand::Sismember => "SISMEMBER",
RespCommand::Smembers => "SMEMBERS",
RespCommand::Smismember => "SMISMEMBER",
RespCommand::Spublish => "SPUBLISH",
RespCommand::Srandmember => "SRANDMEMBER",
RespCommand::Sscan => "SSCAN",
RespCommand::Ssubscribe => "SSUBSCRIBE",
RespCommand::Strlen => "STRLEN",
RespCommand::Substr => "SUBSTR",
RespCommand::Sunion => "SUNION",
RespCommand::Ttl => "TTL",
RespCommand::Type => "TYPE",
RespCommand::Vcard => "VCARD",
RespCommand::Vdim => "VDIM",
RespCommand::Vemb => "VEMB",
RespCommand::Vgetattr => "VGETATTR",
RespCommand::Vinfo => "VINFO",
RespCommand::Vismember => "VISMEMBER",
RespCommand::Vlinks => "VLINKS",
RespCommand::Vrandmember => "VRANDMEMBER",
RespCommand::Vsim => "VSIM",
RespCommand::Watch => "WATCH",
RespCommand::Watchms => "WATCHMS",
RespCommand::Watchos => "WATCHOS",
RespCommand::Zcard => "ZCARD",
RespCommand::Zcount => "ZCOUNT",
RespCommand::Zdiff => "ZDIFF",
RespCommand::Zinter => "ZINTER",
RespCommand::Zintercard => "ZINTERCARD",
RespCommand::Zlexcount => "ZLEXCOUNT",
RespCommand::Zmscore => "ZMSCORE",
RespCommand::Zrandmember => "ZRANDMEMBER",
RespCommand::Zrange => "ZRANGE",
RespCommand::Zrangebylex => "ZRANGEBYLEX",
RespCommand::Zrangebyscore => "ZRANGEBYSCORE",
RespCommand::Zrank => "ZRANK",
RespCommand::Zrevrange => "ZREVRANGE",
RespCommand::Zrevrangebylex => "ZREVRANGEBYLEX",
RespCommand::Zrevrangebyscore => "ZREVRANGEBYSCORE",
RespCommand::Zrevrank => "ZREVRANK",
RespCommand::Zttl => "ZTTL",
RespCommand::Zpttl => "ZPTTL",
RespCommand::Zexpiretime => "ZEXPIRETIME",
RespCommand::Zpexpiretime => "ZPEXPIRETIME",
RespCommand::Zscan => "ZSCAN",
RespCommand::Zscore => "ZSCORE",
RespCommand::Zunion => "ZUNION",
RespCommand::Riconfig => "RICONFIG",
RespCommand::Riexists => "RIEXISTS",
RespCommand::Riget => "RIGET",
RespCommand::Rimetrics => "RIMETRICS",
RespCommand::Rirange => "RIRANGE",
RespCommand::Riscan => "RISCAN",
RespCommand::Eval => "EVAL",
RespCommand::Evalsha => "EVALSHA",
RespCommand::Async => "ASYNC",
RespCommand::Ping => "PING",
RespCommand::Pubsub => "PUBSUB",
RespCommand::PubsubChannels => "PUBSUB_CHANNELS",
RespCommand::PubsubNumpat => "PUBSUB_NUMPAT",
RespCommand::PubsubNumsub => "PUBSUB_NUMSUB",
RespCommand::Publish => "PUBLISH",
RespCommand::Subscribe => "SUBSCRIBE",
RespCommand::Psubscribe => "PSUBSCRIBE",
RespCommand::Unsubscribe => "UNSUBSCRIBE",
RespCommand::Punsubscribe => "PUNSUBSCRIBE",
RespCommand::Asking => "ASKING",
RespCommand::Select => "SELECT",
RespCommand::Echo => "ECHO",
RespCommand::Client => "CLIENT",
RespCommand::ClientId => "CLIENT_ID",
RespCommand::ClientInfo => "CLIENT_INFO",
RespCommand::ClientList => "CLIENT_LIST",
RespCommand::ClientKill => "CLIENT_KILL",
RespCommand::ClientGetname => "CLIENT_GETNAME",
RespCommand::ClientSetname => "CLIENT_SETNAME",
RespCommand::ClientSetinfo => "CLIENT_SETINFO",
RespCommand::ClientUnblock => "CLIENT_UNBLOCK",
RespCommand::Monitor => "MONITOR",
RespCommand::Module => "MODULE",
RespCommand::ModuleLoadcs => "MODULE_LOADCS",
RespCommand::Registercs => "REGISTERCS",
RespCommand::Multi => "MULTI",
RespCommand::Exec => "EXEC",
RespCommand::Discard => "DISCARD",
RespCommand::Unwatch => "UNWATCH",
RespCommand::Runtxp => "RUNTXP",
RespCommand::Readonly => "READONLY",
RespCommand::Readwrite => "READWRITE",
RespCommand::Replicaof => "REPLICAOF",
RespCommand::Secondaryof => "SECONDARYOF",
RespCommand::Info => "INFO",
RespCommand::Time => "TIME",
RespCommand::Role => "ROLE",
RespCommand::Save => "SAVE",
RespCommand::Expdelscan => "EXPDELSCAN",
RespCommand::Lastsave => "LASTSAVE",
RespCommand::Bgsave => "BGSAVE",
RespCommand::Commitaof => "COMMITAOF",
RespCommand::Failover => "FAILOVER",
RespCommand::Customtxn => "CUSTOMTXN",
RespCommand::Customrawstringcmd => "CUSTOMRAWSTRINGCMD",
RespCommand::Customobjcmd => "CUSTOMOBJCMD",
RespCommand::Customprocedure => "CUSTOMPROCEDURE",
RespCommand::Script => "SCRIPT",
RespCommand::ScriptExists => "SCRIPT_EXISTS",
RespCommand::ScriptFlush => "SCRIPT_FLUSH",
RespCommand::ScriptLoad => "SCRIPT_LOAD",
RespCommand::Acl => "ACL",
RespCommand::AclCat => "ACL_CAT",
RespCommand::AclDeluser => "ACL_DELUSER",
RespCommand::AclGenpass => "ACL_GENPASS",
RespCommand::AclGetuser => "ACL_GETUSER",
RespCommand::AclList => "ACL_LIST",
RespCommand::AclLoad => "ACL_LOAD",
RespCommand::AclSave => "ACL_SAVE",
RespCommand::AclSetuser => "ACL_SETUSER",
RespCommand::AclUsers => "ACL_USERS",
RespCommand::AclWhoami => "ACL_WHOAMI",
RespCommand::Command => "COMMAND",
RespCommand::CommandCount => "COMMAND_COUNT",
RespCommand::CommandDocs => "COMMAND_DOCS",
RespCommand::CommandInfo => "COMMAND_INFO",
RespCommand::CommandGetkeys => "COMMAND_GETKEYS",
RespCommand::CommandGetkeysandflags => "COMMAND_GETKEYSANDFLAGS",
RespCommand::Memory => "MEMORY",
RespCommand::Object => "OBJECT",
RespCommand::ObjectHelp => "OBJECT_HELP",
RespCommand::Config => "CONFIG",
RespCommand::ConfigGet => "CONFIG_GET",
RespCommand::ConfigRewrite => "CONFIG_REWRITE",
RespCommand::ConfigSet => "CONFIG_SET",
RespCommand::Debug => "DEBUG",
RespCommand::Latency => "LATENCY",
RespCommand::LatencyHelp => "LATENCY_HELP",
RespCommand::LatencyHistogram => "LATENCY_HISTOGRAM",
RespCommand::LatencyReset => "LATENCY_RESET",
RespCommand::Slowlog => "SLOWLOG",
RespCommand::SlowlogHelp => "SLOWLOG_HELP",
RespCommand::SlowlogLen => "SLOWLOG_LEN",
RespCommand::SlowlogGet => "SLOWLOG_GET",
RespCommand::SlowlogReset => "SLOWLOG_RESET",
RespCommand::Cluster => "CLUSTER",
RespCommand::ClusterAddslots => "CLUSTER_ADDSLOTS",
RespCommand::ClusterAddslotsrange => "CLUSTER_ADDSLOTSRANGE",
RespCommand::ClusterAdvanceTime => "CLUSTER_ADVANCE_TIME",
RespCommand::ClusterAppendlog => "CLUSTER_APPENDLOG",
RespCommand::ClusterAttachSync => "CLUSTER_ATTACH_SYNC",
RespCommand::ClusterBanlist => "CLUSTER_BANLIST",
RespCommand::ClusterBeginReplicaRecover => "CLUSTER_BEGIN_REPLICA_RECOVER",
RespCommand::ClusterBumpepoch => "CLUSTER_BUMPEPOCH",
RespCommand::ClusterCountkeysinslot => "CLUSTER_COUNTKEYSINSLOT",
RespCommand::ClusterDelkeysinslot => "CLUSTER_DELKEYSINSLOT",
RespCommand::ClusterDelkeysinslotrange => "CLUSTER_DELKEYSINSLOTRANGE",
RespCommand::ClusterDelslots => "CLUSTER_DELSLOTS",
RespCommand::ClusterDelslotsrange => "CLUSTER_DELSLOTSRANGE",
RespCommand::ClusterEndpoint => "CLUSTER_ENDPOINT",
RespCommand::ClusterFailover => "CLUSTER_FAILOVER",
RespCommand::ClusterFailreplicationoffset => "CLUSTER_FAILREPLICATIONOFFSET",
RespCommand::ClusterFailstopwrites => "CLUSTER_FAILSTOPWRITES",
RespCommand::ClusterFlushall => "CLUSTER_FLUSHALL",
RespCommand::ClusterForget => "CLUSTER_FORGET",
RespCommand::ClusterGetkeysinslot => "CLUSTER_GETKEYSINSLOT",
RespCommand::ClusterGossip => "CLUSTER_GOSSIP",
RespCommand::ClusterHelp => "CLUSTER_HELP",
RespCommand::ClusterInfo => "CLUSTER_INFO",
RespCommand::ClusterInitiateReplicaSync => "CLUSTER_INITIATE_REPLICA_SYNC",
RespCommand::ClusterKeyslot => "CLUSTER_KEYSLOT",
RespCommand::ClusterMeet => "CLUSTER_MEET",
RespCommand::ClusterMigrate => "CLUSTER_MIGRATE",
RespCommand::ClusterMlogKeyTime => "CLUSTER_MLOG_KEY_TIME",
RespCommand::ClusterMtasks => "CLUSTER_MTASKS",
RespCommand::ClusterMyid => "CLUSTER_MYID",
RespCommand::ClusterMyparentid => "CLUSTER_MYPARENTID",
RespCommand::ClusterNodes => "CLUSTER_NODES",
RespCommand::ClusterPublish => "CLUSTER_PUBLISH",
RespCommand::ClusterSpublish => "CLUSTER_SPUBLISH",
RespCommand::ClusterReplicas => "CLUSTER_REPLICAS",
RespCommand::ClusterReplicate => "CLUSTER_REPLICATE",
RespCommand::ClusterReserve => "CLUSTER_RESERVE",
RespCommand::ClusterReset => "CLUSTER_RESET",
RespCommand::ClusterSendCkptFileSegment => "CLUSTER_SEND_CKPT_FILE_SEGMENT",
RespCommand::ClusterSendCkptMetadata => "CLUSTER_SEND_CKPT_METADATA",
RespCommand::ClusterSetconfigepoch => "CLUSTER_SETCONFIGEPOCH",
RespCommand::ClusterSetslot => "CLUSTER_SETSLOT",
RespCommand::ClusterSetslotsrange => "CLUSTER_SETSLOTSRANGE",
RespCommand::ClusterShards => "CLUSTER_SHARDS",
RespCommand::ClusterSlots => "CLUSTER_SLOTS",
RespCommand::ClusterSlotstate => "CLUSTER_SLOTSTATE",
RespCommand::ClusterSnapshotData => "CLUSTER_SNAPSHOT_DATA",
RespCommand::ClusterSync => "CLUSTER_SYNC",
RespCommand::Auth => "AUTH",
RespCommand::Hello => "HELLO",
RespCommand::Quit => "QUIT",
RespCommand::Invalid => "INVALID",
}
}