(newLeft string, newRight string, c Client)
| 136 | } |
| 137 | |
| 138 | func (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 | |
| 163 | func (ln listNode) updateSideAction(side LSide, newAddress string, c Client) dynamodb.TransactWriteItem { |
| 164 | updater := newExpresionBuilder() |
no test coverage detected