You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamodb provides API which has 'WithContext' postfix.
This is for additional ability to pass a context and additional request parameter.
But there is no BatchWriteItemWithContext API in this project.
When I look over the other source code batch_get_item.go , both BatchGetItem and BatchGetItemWithContext have same body.
It seems to be pretty easy to add 'BatchWriteItemWithContext' which has same body of BatchWriteItem.
When I test with below code, it works well but I can't contribute to this project.
Will Somebody make PR for this?
func (e *MockDynamoDB) BatchWriteItemWithContext(ctx aws.Context, input *dynamodb.BatchWriteItemInput, opt ...request.Option) (*dynamodb.BatchWriteItemOutput, error) {
if len(e.dynaMock.BatchWriteItemExpect) > 0 {
x := e.dynaMock.BatchWriteItemExpect[0] //get first element of expectation
if x.input != nil {
if !reflect.DeepEqual(x.input, input.RequestItems) {
return nil, fmt.Errorf("Expect input %+v but found input %+v", x.input, input.RequestItems)
}
}
// delete first element of expectation
e.dynaMock.BatchWriteItemExpect = append(e.dynaMock.BatchWriteItemExpect[:0], e.dynaMock.BatchWriteItemExpect[1:]...)
return x.output, nil
}
return nil, fmt.Errorf("Batch Write Item Expectation Not Found")
}
The text was updated successfully, but these errors were encountered:
Hi all,
Dynamodb provides API which has 'WithContext' postfix.
This is for additional ability to pass a context and additional request parameter.
But there is no BatchWriteItemWithContext API in this project.
When I look over the other source code batch_get_item.go , both BatchGetItem and BatchGetItemWithContext have same body.
It seems to be pretty easy to add 'BatchWriteItemWithContext' which has same body of BatchWriteItem.
When I test with below code, it works well but I can't contribute to this project.
Will Somebody make PR for this?
func (e *MockDynamoDB) BatchWriteItemWithContext(ctx aws.Context, input *dynamodb.BatchWriteItemInput, opt ...request.Option) (*dynamodb.BatchWriteItemOutput, error) {
if len(e.dynaMock.BatchWriteItemExpect) > 0 {
x := e.dynaMock.BatchWriteItemExpect[0] //get first element of expectation
}
The text was updated successfully, but these errors were encountered: