forked from elliotchance/mocksqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.go
49 lines (40 loc) · 1.42 KB
/
create.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package mocksqs
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/sqs"
)
// CreateQueue is partially implemented. The following fields are not
// implemented:
//
// - Attributes: DelaySeconds, MaximumMessageSize, MessageRetentionPeriod,
// Policy, ReceiveMessageWaitTimeSeconds, RedrivePolicy, VisibilityTimeout,
// KmsMasterKeyId, KmsDataKeyReusePeriodSeconds, FifoQueue,
// ContentBasedDeduplication
//
// - Tags
//
func (client *SQS) CreateQueue(input *sqs.CreateQueueInput) (*sqs.CreateQueueOutput, error) {
client.httpRequest()
client.Lock()
defer client.Unlock()
if input.QueueName == nil {
return &sqs.CreateQueueOutput{},
errorMissingField("CreateQueueInput.QueueName")
}
queueURL := CreateQueueURL(*input.QueueName)
if client.GetQueue(queueURL) == nil {
client.queues.Store(queueURL, newQueue(queueURL))
}
return &sqs.CreateQueueOutput{
QueueUrl: &queueURL,
}, nil
}
// CreateQueueWithContext is not implemented. It will panic in all cases.
func (client *SQS) CreateQueueWithContext(aws.Context, *sqs.CreateQueueInput, ...request.Option) (*sqs.CreateQueueOutput, error) {
panic("CreateQueueWithContext is not implemented")
}
// CreateQueueRequest is not implemented. It will panic in all cases.
func (client *SQS) CreateQueueRequest(*sqs.CreateQueueInput) (*request.Request, *sqs.CreateQueueOutput) {
panic("CreateQueueRequest is not implemented")
}