MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / GET

Method GET

strings.go:16–29  ·  view source on GitHub ↗

GET fetches the value at the given key. If the key does not exist, the ReturnValue will be Empty(). Works similar to https://redis.io/commands/get

(key string)

Source from the content-addressed store, hash-verified

14//
15// Works similar to https://redis.io/commands/get
16func (c Client) GET(key string) (val ReturnValue, err error) {
17 resp, err := c.ddbClient.GetItemRequest(&dynamodb.GetItemInput{
18 ConsistentRead: aws.Bool(c.consistentReads),
19 Key: keyDef{pk: key, sk: emptySK}.toAV(c),
20 TableName: aws.String(c.table),
21 }).Send(context.TODO())
22 if err != nil || len(resp.Item) == 0 {
23 return
24 }
25
26 val = ReturnValue{resp.Item[vk]}
27
28 return
29}
30
31// SET stores the given Value at the given key. If called as SET("key", "value", None), SET is
32// unconditional and is not expected to fail.

Callers 4

TestBasicFunction · 0.80
TestGETSETFunction · 0.80
TestCountersFunction · 0.80
TestAtomicOpsFunction · 0.80

Calls 2

toAVMethod · 0.45
StringMethod · 0.45

Tested by 4

TestBasicFunction · 0.64
TestGETSETFunction · 0.64
TestCountersFunction · 0.64
TestAtomicOpsFunction · 0.64