vendor: update all dependencies to latest versions
This commit is contained in:
+3
-3
@@ -17,6 +17,7 @@
|
||||
package builder
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -29,7 +30,6 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/pengsrc/go-shared/convert"
|
||||
"github.com/pengsrc/go-shared/json"
|
||||
|
||||
"github.com/yunify/qingstor-sdk-go/request/data"
|
||||
"github.com/yunify/qingstor-sdk-go/utils"
|
||||
@@ -100,7 +100,7 @@ func (b *BaseBuilder) parseRequestQueryAndHeaders() error {
|
||||
requestQuery := map[string]string{}
|
||||
requestHeaders := map[string]string{}
|
||||
maps := map[string](map[string]string){
|
||||
"query": requestQuery,
|
||||
"query": requestQuery,
|
||||
"headers": requestHeaders,
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ func (b *BaseBuilder) parseRequestBody() error {
|
||||
}
|
||||
|
||||
if len(requestData) != 0 {
|
||||
dataValue, err := json.Encode(requestData, true)
|
||||
dataValue, err := json.Marshal(requestData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+9
-9
@@ -75,24 +75,24 @@ func (qb *QingStorBuilder) BuildHTTPRequest(o *data.Operation, i *reflect.Value)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"Built QingStor request: [%d] %s",
|
||||
convert.StringToUnixTimestamp(httpRequest.Header.Get("Date"), convert.RFC822),
|
||||
httpRequest.URL.String()),
|
||||
)
|
||||
httpRequest.URL.String(),
|
||||
))
|
||||
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"QingStor request headers: [%d] %s",
|
||||
convert.StringToUnixTimestamp(httpRequest.Header.Get("Date"), convert.RFC822),
|
||||
fmt.Sprint(httpRequest.Header)),
|
||||
)
|
||||
fmt.Sprint(httpRequest.Header),
|
||||
))
|
||||
|
||||
if qb.baseBuilder.parsedBodyString != "" {
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"QingStor request body string: [%d] %s",
|
||||
convert.StringToUnixTimestamp(httpRequest.Header.Get("Date"), convert.RFC822),
|
||||
qb.baseBuilder.parsedBodyString),
|
||||
)
|
||||
qb.baseBuilder.parsedBodyString,
|
||||
))
|
||||
}
|
||||
|
||||
return httpRequest, nil
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ func (r *Request) send() error {
|
||||
retries := r.Operation.Config.ConnectionRetries + 1
|
||||
for {
|
||||
if retries > 0 {
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"Sending request: [%d] %s %s",
|
||||
convert.StringToUnixTimestamp(r.HTTPRequest.Header.Get("Date"), convert.RFC822),
|
||||
r.Operation.RequestMethod,
|
||||
|
||||
+5
-5
@@ -85,7 +85,7 @@ func (qss *QingStorSigner) BuildSignature(request *http.Request) (string, error)
|
||||
signature := strings.TrimSpace(base64.StdEncoding.EncodeToString(h.Sum(nil)))
|
||||
authorization := "QS " + qss.AccessKeyID + ":" + signature
|
||||
|
||||
logger.Debugf(fmt.Sprintf(
|
||||
logger.Debugf(nil, fmt.Sprintf(
|
||||
"QingStor authorization: [%d] %s",
|
||||
convert.StringToUnixTimestamp(request.Header.Get("Date"), convert.RFC822),
|
||||
authorization,
|
||||
@@ -111,7 +111,7 @@ func (qss *QingStorSigner) BuildQuerySignature(request *http.Request, expires in
|
||||
qss.AccessKeyID, expires, signature,
|
||||
)
|
||||
|
||||
logger.Debugf(fmt.Sprintf(
|
||||
logger.Debugf(nil, fmt.Sprintf(
|
||||
"QingStor query signature: [%d] %s",
|
||||
convert.StringToUnixTimestamp(request.Header.Get("Date"), convert.RFC822),
|
||||
query,
|
||||
@@ -141,7 +141,7 @@ func (qss *QingStorSigner) BuildStringToSign(request *http.Request) (string, err
|
||||
}
|
||||
stringToSign += canonicalizedResource
|
||||
|
||||
logger.Debugf(fmt.Sprintf(
|
||||
logger.Debugf(nil, fmt.Sprintf(
|
||||
"QingStor string to sign: [%d] %s",
|
||||
convert.StringToUnixTimestamp(request.Header.Get("Date"), convert.RFC822),
|
||||
stringToSign,
|
||||
@@ -167,7 +167,7 @@ func (qss *QingStorSigner) BuildQueryStringToSign(request *http.Request, expires
|
||||
}
|
||||
stringToSign += canonicalizedResource
|
||||
|
||||
logger.Debugf(fmt.Sprintf(
|
||||
logger.Debugf(nil, fmt.Sprintf(
|
||||
"QingStor query string to sign: [%d] %s",
|
||||
convert.StringToUnixTimestamp(request.Header.Get("Date"), convert.RFC822),
|
||||
stringToSign,
|
||||
@@ -231,7 +231,7 @@ func (qss *QingStorSigner) buildCanonicalizedResource(request *http.Request) (st
|
||||
path = path + "?" + joinedParts
|
||||
}
|
||||
|
||||
logger.Debugf(fmt.Sprintf(
|
||||
logger.Debugf(nil, fmt.Sprintf(
|
||||
"QingStor canonicalized resource: [%d] %s",
|
||||
convert.StringToUnixTimestamp(request.Header.Get("Date"), convert.RFC822),
|
||||
path,
|
||||
|
||||
+6
-6
@@ -18,6 +18,7 @@ package unpacker
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
@@ -25,7 +26,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/pengsrc/go-shared/convert"
|
||||
"github.com/pengsrc/go-shared/json"
|
||||
|
||||
"github.com/yunify/qingstor-sdk-go/logger"
|
||||
"github.com/yunify/qingstor-sdk-go/request/data"
|
||||
@@ -69,7 +69,7 @@ func (b *BaseUnpacker) exposeStatusCode() error {
|
||||
if value.IsValid() {
|
||||
switch value.Interface().(type) {
|
||||
case *int:
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"QingStor response status code: [%d] %d",
|
||||
convert.StringToUnixTimestamp(b.httpResponse.Header.Get("Date"), convert.RFC822),
|
||||
b.httpResponse.StatusCode,
|
||||
@@ -82,7 +82,7 @@ func (b *BaseUnpacker) exposeStatusCode() error {
|
||||
}
|
||||
|
||||
func (b *BaseUnpacker) parseResponseHeaders() error {
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"QingStor response headers: [%d] %s",
|
||||
convert.StringToUnixTimestamp(b.httpResponse.Header.Get("Date"), convert.RFC822),
|
||||
fmt.Sprint(b.httpResponse.Header),
|
||||
@@ -145,7 +145,7 @@ func (b *BaseUnpacker) parseResponseBody() error {
|
||||
buffer.ReadFrom(b.httpResponse.Body)
|
||||
b.httpResponse.Body.Close()
|
||||
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"QingStor response body string: [%d] %s",
|
||||
convert.StringToUnixTimestamp(b.httpResponse.Header.Get("Date"), convert.RFC822),
|
||||
string(buffer.Bytes()),
|
||||
@@ -168,13 +168,13 @@ func (b *BaseUnpacker) parseResponseElements() error {
|
||||
buffer.ReadFrom(b.httpResponse.Body)
|
||||
b.httpResponse.Body.Close()
|
||||
|
||||
logger.Infof(fmt.Sprintf(
|
||||
logger.Infof(nil, fmt.Sprintf(
|
||||
"QingStor response body string: [%d] %s",
|
||||
convert.StringToUnixTimestamp(b.httpResponse.Header.Get("Date"), convert.RFC822),
|
||||
string(buffer.Bytes()),
|
||||
))
|
||||
|
||||
_, err := json.Decode(buffer.Bytes(), b.output.Interface())
|
||||
err := json.Unmarshal(buffer.Bytes(), b.output.Interface())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+2
-3
@@ -18,11 +18,10 @@ package unpacker
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"github.com/pengsrc/go-shared/json"
|
||||
|
||||
"github.com/yunify/qingstor-sdk-go/request/data"
|
||||
"github.com/yunify/qingstor-sdk-go/request/errors"
|
||||
)
|
||||
@@ -57,7 +56,7 @@ func (qu *QingStorUnpacker) parseError() error {
|
||||
|
||||
qsError := &errors.QingStorError{}
|
||||
if buffer.Len() > 0 {
|
||||
_, err := json.Decode(buffer.Bytes(), qsError)
|
||||
err := json.Unmarshal(buffer.Bytes(), qsError)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user