mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Update vendor
This commit is contained in:
14
fn/vendor/github.com/go-resty/resty/client.go
generated
vendored
14
fn/vendor/github.com/go-resty/resty/client.go
generated
vendored
@@ -87,6 +87,8 @@ type Client struct {
|
||||
RetryWaitTime time.Duration
|
||||
RetryMaxWaitTime time.Duration
|
||||
RetryConditions []RetryConditionFunc
|
||||
JSONMarshal func(v interface{}) ([]byte, error)
|
||||
JSONUnmarshal func(data []byte, v interface{}) error
|
||||
|
||||
httpClient *http.Client
|
||||
transport *http.Transport
|
||||
@@ -811,6 +813,7 @@ func IsXMLType(ct string) bool {
|
||||
}
|
||||
|
||||
// Unmarshal content into object from JSON or XML
|
||||
// Deprecated: kept for backward compatibility
|
||||
func Unmarshal(ct string, b []byte, d interface{}) (err error) {
|
||||
if IsJSONType(ct) {
|
||||
err = json.Unmarshal(b, d)
|
||||
@@ -821,6 +824,17 @@ func Unmarshal(ct string, b []byte, d interface{}) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Unmarshalc content into object from JSON or XML
|
||||
func Unmarshalc(c *Client, ct string, b []byte, d interface{}) (err error) {
|
||||
if IsJSONType(ct) {
|
||||
err = c.JSONUnmarshal(b, d)
|
||||
} else if IsXMLType(ct) {
|
||||
err = xml.Unmarshal(b, d)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func getLogger(w io.Writer) *log.Logger {
|
||||
return log.New(w, "RESTY ", log.LstdFlags)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user