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

Method listFindEnd

lists.go:470–503  ·  view source on GitHub ↗
(key string, side LSide)

Source from the content-addressed store, hash-verified

468}
469
470func (c Client) listFindEnd(key string, side LSide) (node listNode, found bool, err error) {
471 queryCondition := newExpresionBuilder()
472 queryCondition.addConditionEquality(c.pk, StringValue{key})
473 queryCondition.addConditionEquality(c.skN, IntValue{1})
474
475 resp, err := c.ddbClient.QueryRequest(&dynamodb.QueryInput{
476 ConsistentRead: aws.Bool(true),
477 ExpressionAttributeNames: queryCondition.expressionAttributeNames(),
478 ExpressionAttributeValues: queryCondition.expressionAttributeValues(),
479 IndexName: aws.String(c.index),
480 KeyConditionExpression: queryCondition.conditionExpression(),
481 Limit: aws.Int64(capCount),
482 TableName: aws.String(c.table),
483 }).Send(context.TODO())
484
485 if err != nil || len(resp.Items) == 0 {
486 return
487 }
488
489 for _, item := range resp.Items {
490 node = lParseNode(item, c)
491 node, found, err = c.listGetByAddress(key, node.address)
492
493 if !found || err != nil {
494 return
495 }
496
497 if node.prev(side) == listNull {
498 return node, true, nil
499 }
500 }
501
502 return
503}
504
505func (c Client) listGetByAddress(key string, address string) (node listNode, found bool, err error) {
506 resp, err := c.ddbClient.GetItemRequest(&dynamodb.GetItemInput{

Callers 5

listNodeAtIndexMethod · 0.95
listNodeAtPivotMethod · 0.95
listPopActionsMethod · 0.95
listPushActionsMethod · 0.95
listRotateMethod · 0.95

Calls 9

listGetByAddressMethod · 0.95
newExpresionBuilderFunction · 0.85
lParseNodeFunction · 0.85
addConditionEqualityMethod · 0.80
conditionExpressionMethod · 0.80
prevMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected