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

Method updateBothSidesAction

lists.go:138–161  ·  view source on GitHub ↗
(newLeft string, newRight string, c Client)

Source from the content-addressed store, hash-verified

136}
137
138func (ln listNode) updateBothSidesAction(newLeft string, newRight string, c Client) dynamodb.TransactWriteItem {
139 updater := newExpresionBuilder()
140 updater.addConditionEquality(skLeft, StringValue{ln.left})
141 updater.addConditionEquality(skRight, StringValue{ln.right})
142 updater.updateSET(skLeft, StringValue{newLeft})
143 updater.updateSET(skRight, StringValue{newRight})
144
145 if newLeft == listNull || newRight == listNull {
146 updater.updateSET(c.skN, IntValue{1})
147 } else {
148 updater.updateSET(c.skN, IntValue{0})
149 }
150
151 return dynamodb.TransactWriteItem{
152 Update: &dynamodb.Update{
153 ConditionExpression: updater.conditionExpression(),
154 ExpressionAttributeNames: updater.expressionAttributeNames(),
155 ExpressionAttributeValues: updater.expressionAttributeValues(),
156 Key: ln.keyAV(c),
157 TableName: aws.String(c.table),
158 UpdateExpression: updater.updateExpression(),
159 },
160 }
161}
162
163func (ln listNode) updateSideAction(side LSide, newAddress string, c Client) dynamodb.TransactWriteItem {
164 updater := newExpresionBuilder()

Callers 1

listRotateMethod · 0.80

Calls 9

keyAVMethod · 0.95
newExpresionBuilderFunction · 0.85
addConditionEqualityMethod · 0.80
updateSETMethod · 0.80
conditionExpressionMethod · 0.80
updateExpressionMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected