Merged in feature/momocks (pull request #150)
Decrease Mocks * feature/nomocks * nonet * assertsaws * assert
This commit is contained in:
@@ -7,16 +7,27 @@ import (
|
||||
)
|
||||
|
||||
type ReceiveParams struct {
|
||||
QueueURL string
|
||||
Attributes []string
|
||||
QueueURL string
|
||||
Attributes []string
|
||||
VisibilityTimeout int32
|
||||
WaitTimeSeconds int32
|
||||
}
|
||||
|
||||
func (c *QueueConfig) ReceiveFromQueue(ctx context.Context, params *ReceiveParams) (*sqs.ReceiveMessageOutput, error) {
|
||||
return c.QueueClient.ReceiveMessage(ctx, &sqs.ReceiveMessageInput{
|
||||
p := &sqs.ReceiveMessageInput{
|
||||
QueueUrl: ¶ms.QueueURL,
|
||||
MaxNumberOfMessages: 1,
|
||||
WaitTimeSeconds: 10,
|
||||
VisibilityTimeout: 10,
|
||||
MessageAttributeNames: params.Attributes,
|
||||
})
|
||||
}
|
||||
|
||||
if params.VisibilityTimeout > 0 {
|
||||
p.VisibilityTimeout = params.VisibilityTimeout
|
||||
}
|
||||
if params.WaitTimeSeconds > 0 {
|
||||
p.WaitTimeSeconds = params.WaitTimeSeconds
|
||||
}
|
||||
|
||||
return c.QueueClient.ReceiveMessage(ctx, p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user