Skip to content

Commit

Permalink
fix: uptate cast到v1.3.0version (#9)
Browse files Browse the repository at this point in the history
* fix: uptate cast到v1.3.0version

* fix: go.sum
  • Loading branch information
Kotagan authored Apr 4, 2020
1 parent eaf5fa4 commit ac2a5bb
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 23 deletions.
3 changes: 2 additions & 1 deletion batch_peek_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand All @@ -21,7 +22,7 @@ func (c *Client) BatchPeekMessage(name string) (*BatchPeekMessageResponse, error
requestLine := fmt.Sprintf(mnsBatchPeekMessage, name, "16")
req := c.ca.NewRequest().Get().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion batch_receive_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand Down Expand Up @@ -36,7 +37,7 @@ func (c *Client) BatchReceiveMessage(name string, setters ...ReceiveMessageParam
requestLine := fmt.Sprintf(mnsBatchReceiveMessage, name)
req := c.ca.NewRequest().Get().WithPath(requestLine).WithQueryParam(&receiveMessage)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion batch_send_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand Down Expand Up @@ -54,7 +55,7 @@ start:
return nil, err
}

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion change_visibility_timeout.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand Down Expand Up @@ -30,7 +31,7 @@ func (c *Client) ChangeVisibilityTimeout(
requestLine := fmt.Sprintf(mnsChangeMessageVisibility, name, receiptHandle, strconv.Itoa(visibilityTimeout))
req := c.ca.NewRequest().Put().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion create_queue.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -31,7 +32,7 @@ func (c *Client) CreateQueue(name string, setters ...QueueAttributeSetter) (stri
requestLine := fmt.Sprintf(mnsCreateQueue, name)
req := c.ca.NewRequest().Put().WithPath(requestLine).WithXMLBody(&attri).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return "", err
}
Expand Down
3 changes: 2 additions & 1 deletion create_topic.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -26,7 +27,7 @@ func (c *Client) CreateTopic(name string, setters ...TopicAttributeSetter) error
requestLine := fmt.Sprintf(mnsCreateTopic, name)
req := c.ca.NewRequest().Put().WithPath(requestLine).WithXMLBody(&attri).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion delete_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -13,7 +14,7 @@ func (c *Client) DeleteMessage(name, receiptHandle string) error {
requestLine := fmt.Sprintf(mnsDeleteMessage, name, receiptHandle)
req := c.ca.NewRequest().Delete().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion delete_queue.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -13,7 +14,7 @@ func (c *Client) DeleteQueue(name string) error {
requestLine := fmt.Sprintf(mnsDeleteQueue, name)
req := c.ca.NewRequest().Delete().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion delete_topic.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -13,7 +14,7 @@ func (c *Client) DeleteTopic(name string) error {
requestLine := fmt.Sprintf(mnsDeleteTopic, name)
req := c.ca.NewRequest().Delete().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion get_queue_attribute.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand Down Expand Up @@ -31,7 +32,7 @@ func (c *Client) GetQueueAttributes(name string) (*QueueAttributeResponse, error
requestLine := fmt.Sprintf(mnsGetQueueAttributes, name)
req := c.ca.NewRequest().Get().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/onsi/gomega v1.8.1 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/vmihailenco/msgpack v4.0.4+incompatible
github.com/xiaojiaoyu100/cast v1.2.9
github.com/xiaojiaoyu100/cast v1.3.0
github.com/xiaojiaoyu100/curlew v0.2.3
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9 // indirect
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/xiaojiaoyu100/cast v1.2.9 h1:hL8fiPhOnDrkToiORrBMn1XZrZyyMaqB5XVfCI1lJ3g=
github.com/xiaojiaoyu100/cast v1.2.9/go.mod h1:smc6oedQStn3NkaLOySSku1MDWcZHKA+hZDijVyyNcs=
github.com/xiaojiaoyu100/cast v1.3.0 h1:XoMMGSKB/jdfQ8Y83p3rf3lQjdDV5Ai1bdXP+pXbjr0=
github.com/xiaojiaoyu100/cast v1.3.0/go.mod h1:smc6oedQStn3NkaLOySSku1MDWcZHKA+hZDijVyyNcs=
github.com/xiaojiaoyu100/curlew v0.2.3 h1:i3S6MU3TEsR77vN34zDTYHuhGHXg7i/yDBXL0mkamGY=
github.com/xiaojiaoyu100/curlew v0.2.3/go.mod h1:T1E4wpTXciXHO0YJPhHz8sQB/MGPLt+M7efYFKK36Hg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
3 changes: 2 additions & 1 deletion list_queue.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"net/http"
Expand Down Expand Up @@ -42,7 +43,7 @@ func (c *Client) ListQueue(request *ListQueueRequest) (*ListQueueResponse, error
req.SetHeader(xMnxPrefix, request.Prefix)
}

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion peek_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -29,7 +30,7 @@ func (c *Client) PeekMessage(name string) (*PeekMessageResponse, error) {
requestLine := fmt.Sprintf(mnsPeekMessage, name)
req := c.ca.NewRequest().Get().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion publish_msg.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand Down Expand Up @@ -38,7 +39,7 @@ func (c *Client) PublishMessage(topic, message string, setters ...PublishMessage
requestLine := fmt.Sprintf(mnsPublishMessage, topic)
req := c.ca.NewRequest().Post().WithPath(requestLine).WithXMLBody(&publishMessageParam).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return "", err
}
Expand Down
3 changes: 2 additions & 1 deletion queue_meta_override.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -21,7 +22,7 @@ func (c *Client) QueueMetaOverride(name string, setters ...QueueAttributeSetter)
requestLine := fmt.Sprintf(mnsQueueMetaOverride, name)
req := c.ca.NewRequest().Put().WithPath(requestLine).WithXMLBody(&attri).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion receive_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/xml"
"errors"
"fmt"
Expand Down Expand Up @@ -83,7 +84,7 @@ func (c *Client) ReceiveMessage(name string, setters ...ReceiveMessageParamSette
requestLine := fmt.Sprintf(mnsReceiveMessage, name)
req := c.ca.NewRequest().Get().WithPath(requestLine).WithQueryParam(&receiveMessage)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down
5 changes: 3 additions & 2 deletions send_message.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"encoding/base64"
"encoding/json"
"errors"
Expand Down Expand Up @@ -36,7 +37,7 @@ func (c *Client) send(name string, message Message) (*SendMessageResponse, error
var err error
requestLine := fmt.Sprintf(mnsSendMessage, name)
req := c.ca.NewRequest().Post().WithPath(requestLine).WithXMLBody(&message)
resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -104,7 +105,7 @@ func (c *Client) sendMessage(name, messageBody string, setters ...MessageSetter)
requestLine := fmt.Sprintf(mnsSendMessage, name)
req := c.ca.NewRequest().Post().WithPath(requestLine).WithXMLBody(&attri)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if shouldRetry(err) {
c.pushRetryQueue(name, attri)
}
Expand Down
3 changes: 2 additions & 1 deletion set_topic_attributes.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -26,7 +27,7 @@ func (c *Client) SetTopicAttributes(topic string, setters ...TopicAttributeSette
requestLine := fmt.Sprintf(mnsSetTopicAttributes, topic)
req := c.ca.NewRequest().Put().WithPath(requestLine).WithXMLBody(&attri).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion topic_subscribe.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -47,7 +48,7 @@ func (c *Client) Subscribe(topic, subscription string, endpoint EndPointer, sett
requestLine := fmt.Sprintf(mnsSubscribe, topic, subscription)

req := c.ca.NewRequest().Put().WithPath(requestLine).WithXMLBody(&subscribeParam).WithTimeout(apiTimeout)
resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)

if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion topic_unsubscribe.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package alimns

import (
"context"
"errors"
"fmt"
"net/http"
Expand All @@ -21,7 +22,7 @@ func (c *Client) Unsubscribe(topic, subscription string) error {
requestLine := fmt.Sprintf(mnsUnsubscribe, topic, subscription)
req := c.ca.NewRequest().Delete().WithPath(requestLine).WithTimeout(apiTimeout)

resp, err := c.ca.Do(req)
resp, err := c.ca.Do(context.TODO(), req)
if err != nil {
return err
}
Expand Down

0 comments on commit ac2a5bb

Please sign in to comment.