GET
GET returns the value stored under a key. Every key pins to exactly one
shard via FNV-1a hashing, so the lookup touches a single shard and never
crosses shard boundaries (see Architecture).
RESP2 (Redis-compatible)
Section titled “RESP2 (Redis-compatible)”GET keyReply: the value as a bulk string, or a null reply ($-1) when the key
doesn’t exist or has expired.
> SET greeting hello+OK> GET greeting$5hello> GET missing$-1Native binary protocol
Section titled “Native binary protocol”The client package exposes Get:
c, _ := client.Dial("127.0.0.1:9988", 2*time.Second)defer c.Close()
scratch := make([]byte, 4096)val, err := c.Get([]byte("greeting"), scratch)if err != nil { log.Fatal(err)}fmt.Println(string(val))key— the key bytes.scratchBuf— a reusable response buffer; it must be large enough to hold the value and is returned reused, so the caller should copy the result if it outlives the next call.- A missing or expired key is reported as a not-found error (no value returned), matching RESP’s null reply.
Error handling
Section titled “Error handling”- Wrong arity replies
-ERR wrong number of arguments for 'get' command. - With RBAC enabled,
GETis gated per key; a denial replies-NOPERM.