File tree 1 file changed +6
-20
lines changed
1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -22,43 +22,29 @@ type SQS struct {
22
22
}
23
23
24
24
// New returns a new SQS client.
25
- func New (creds aws.CredentialsProvider , region string , client * http.Client ) * SQS {
25
+ func New (creds aws.CredentialsProvider , region string , endpoint string , client * http.Client ) * SQS {
26
26
if client == nil {
27
27
client = http .DefaultClient
28
28
}
29
29
30
- endpoint , service , region := endpoints . Lookup ( "sqs" , region )
30
+ service := "sqs"
31
31
32
- return & SQS {
33
- client : & aws.QueryClient {
34
- Context : aws.Context {
35
- Credentials : creds ,
36
- Service : service ,
37
- Region : region ,
38
- },
39
- Client : client ,
40
- Endpoint : endpoint ,
41
- APIVersion : "2012-11-05" ,
42
- },
32
+ if endpoint == "" {
33
+ endpoint , service , region = endpoints .Lookup ("sqs" , region )
43
34
}
44
- }
45
-
46
- func NewWithCustomEndpoint (creds aws.CredentialsProvider , endpoint string ) * SQS {
47
- client := http .DefaultClient
48
35
49
36
return & SQS {
50
37
client : & aws.QueryClient {
51
38
Context : aws.Context {
52
39
Credentials : creds ,
53
- Service : "sqs" ,
54
- Region : "local" ,
40
+ Service : service ,
41
+ Region : region ,
55
42
},
56
43
Client : client ,
57
44
Endpoint : endpoint ,
58
45
APIVersion : "2012-11-05" ,
59
46
},
60
47
}
61
-
62
48
}
63
49
64
50
// AddPermission adds a permission to a queue for a specific principal .
You can’t perform that action at this time.
0 commit comments