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

Method HGETALL

hashes.go:154–190  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

152}
153
154func (c Client) HGETALL(key string) (fieldValues map[string]ReturnValue, err error) {
155 fieldValues = make(map[string]ReturnValue)
156 hasMoreResults := true
157
158 var lastEvaluatedKey map[string]dynamodb.AttributeValue
159
160 for hasMoreResults {
161 builder := newExpresionBuilder()
162 builder.addConditionEquality(c.pk, StringValue{key})
163
164 resp, err := c.ddbClient.QueryRequest(&dynamodb.QueryInput{
165 ConsistentRead: aws.Bool(c.consistentReads),
166 ExclusiveStartKey: lastEvaluatedKey,
167 ExpressionAttributeNames: builder.expressionAttributeNames(),
168 ExpressionAttributeValues: builder.expressionAttributeValues(),
169 KeyConditionExpression: builder.conditionExpression(),
170 TableName: aws.String(c.table),
171 }).Send(context.TODO())
172
173 if err != nil {
174 return fieldValues, err
175 }
176
177 for _, item := range resp.Items {
178 parsedItem := parseItem(item, c)
179 fieldValues[parsedItem.sk] = parsedItem.val
180 }
181
182 if len(resp.LastEvaluatedKey) > 0 {
183 lastEvaluatedKey = resp.LastEvaluatedKey
184 } else {
185 hasMoreResults = false
186 }
187 }
188
189 return
190}
191
192func (c Client) HINCRBYFLOAT(key string, field string, delta float64) (after float64, err error) {
193 rv, err := c.hIncr(key, field, FloatValue{delta})

Callers 2

HVALSMethod · 0.95
TestBasicHashesFunction · 0.80

Calls 7

newExpresionBuilderFunction · 0.85
parseItemFunction · 0.85
addConditionEqualityMethod · 0.80
conditionExpressionMethod · 0.80
StringMethod · 0.45

Tested by 1

TestBasicHashesFunction · 0.64