forked from elliotchance/mocksqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.go
50 lines (39 loc) · 1.59 KB
/
list.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
50
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"
"strings"
)
// ListQueues is fully supported.
func (client *SQS) ListQueues(input *sqs.ListQueuesInput) (*sqs.ListQueuesOutput, error) {
client.httpRequest()
prefix := ""
if input.QueueNamePrefix != nil {
prefix = *input.QueueNamePrefix
}
output := &sqs.ListQueuesOutput{}
client.queues.Range(func(key, value interface{}) bool {
if strings.HasPrefix(key.(string), prefix) {
output.QueueUrls = append(output.QueueUrls, &value.(*Queue).URL)
}
return true
})
return output, nil
}
// ListQueuesWithContext is not implemented. It will panic in all cases.
func (client *SQS) ListQueuesWithContext(aws.Context, *sqs.ListQueuesInput, ...request.Option) (*sqs.ListQueuesOutput, error) {
panic("ListQueuesWithContext is not implemented")
}
// ListQueuesRequest is not implemented. It will panic in all cases.
func (client *SQS) ListQueuesRequest(*sqs.ListQueuesInput) (*request.Request, *sqs.ListQueuesOutput) {
panic("ListQueuesRequest is not implemented")
}
// ListQueuesPages is not implemented. It will panic in all cases.
func (client *SQS) ListQueuesPages(*sqs.ListQueuesInput, func(*sqs.ListQueuesOutput, bool) bool) error {
panic("ListQueuesPages is not implemented")
}
// ListQueuesPagesWithContext is not implemented. It will panic in all cases.
func (client *SQS) ListQueuesPagesWithContext(aws.Context, *sqs.ListQueuesInput, func(*sqs.ListQueuesOutput, bool) bool, ...request.Option) error {
panic("ListQueuesPagesWithContext is not implemented")
}