Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c8866ab5
Commit
c8866ab5
authored
Nov 02, 2017
by
Ivan Towlson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade go-autorest to 9.1.0
parent
14e134ce
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
640 additions
and
50 deletions
+640
-50
Godeps.json
Godeps/Godeps.json
+12
-12
config.go
vendor/github.com/Azure/go-autorest/autorest/adal/config.go
+14
-0
devicetoken.go
...github.com/Azure/go-autorest/autorest/adal/devicetoken.go
+14
-0
msi.go
vendor/github.com/Azure/go-autorest/autorest/adal/msi.go
+14
-0
msi_windows.go
...github.com/Azure/go-autorest/autorest/adal/msi_windows.go
+14
-0
persist.go
vendor/github.com/Azure/go-autorest/autorest/adal/persist.go
+14
-0
sender.go
vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
+14
-0
token.go
vendor/github.com/Azure/go-autorest/autorest/adal/token.go
+14
-0
authorization.go
...or/github.com/Azure/go-autorest/autorest/authorization.go
+14
-0
autorest.go
vendor/github.com/Azure/go-autorest/autorest/autorest.go
+14
-0
BUILD
vendor/github.com/Azure/go-autorest/autorest/azure/BUILD
+1
-0
async.go
vendor/github.com/Azure/go-autorest/autorest/azure/async.go
+14
-0
azure.go
vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
+21
-1
environments.go
...thub.com/Azure/go-autorest/autorest/azure/environments.go
+14
-0
rp.go
vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
+188
-0
client.go
vendor/github.com/Azure/go-autorest/autorest/client.go
+17
-3
date.go
vendor/github.com/Azure/go-autorest/autorest/date/date.go
+14
-0
time.go
vendor/github.com/Azure/go-autorest/autorest/date/time.go
+14
-0
timerfc1123.go
...github.com/Azure/go-autorest/autorest/date/timerfc1123.go
+14
-0
unixtime.go
...or/github.com/Azure/go-autorest/autorest/date/unixtime.go
+14
-0
utility.go
vendor/github.com/Azure/go-autorest/autorest/date/utility.go
+14
-0
error.go
vendor/github.com/Azure/go-autorest/autorest/error.go
+14
-0
preparer.go
vendor/github.com/Azure/go-autorest/autorest/preparer.go
+14
-0
responder.go
vendor/github.com/Azure/go-autorest/autorest/responder.go
+14
-0
retriablerequest.go
...github.com/Azure/go-autorest/autorest/retriablerequest.go
+14
-0
retriablerequest_1.7.go
...ub.com/Azure/go-autorest/autorest/retriablerequest_1.7.go
+23
-13
retriablerequest_1.8.go
...ub.com/Azure/go-autorest/autorest/retriablerequest_1.8.go
+26
-16
sender.go
vendor/github.com/Azure/go-autorest/autorest/sender.go
+14
-0
convert.go
vendor/github.com/Azure/go-autorest/autorest/to/convert.go
+14
-0
utility.go
vendor/github.com/Azure/go-autorest/autorest/utility.go
+14
-0
validation.go
...b.com/Azure/go-autorest/autorest/validation/validation.go
+16
-5
version.go
vendor/github.com/Azure/go-autorest/autorest/version.go
+14
-0
No files found.
Godeps/Godeps.json
View file @
c8866ab5
...
...
@@ -68,33 +68,33 @@
},
{
"ImportPath"
:
"github.com/Azure/go-autorest/autorest"
,
"Comment"
:
"v9.
0
.0"
,
"Rev"
:
"
f6be1abbb5abd0517522f850dd785990d373da7
e"
"Comment"
:
"v9.
1
.0"
,
"Rev"
:
"
e14a70c556c8e0db173358d1a903dca345a8e75
e"
},
{
"ImportPath"
:
"github.com/Azure/go-autorest/autorest/adal"
,
"Comment"
:
"v9.
0
.0"
,
"Rev"
:
"
f6be1abbb5abd0517522f850dd785990d373da7
e"
"Comment"
:
"v9.
1
.0"
,
"Rev"
:
"
e14a70c556c8e0db173358d1a903dca345a8e75
e"
},
{
"ImportPath"
:
"github.com/Azure/go-autorest/autorest/azure"
,
"Comment"
:
"v9.
0
.0"
,
"Rev"
:
"
f6be1abbb5abd0517522f850dd785990d373da7
e"
"Comment"
:
"v9.
1
.0"
,
"Rev"
:
"
e14a70c556c8e0db173358d1a903dca345a8e75
e"
},
{
"ImportPath"
:
"github.com/Azure/go-autorest/autorest/date"
,
"Comment"
:
"v9.
0
.0"
,
"Rev"
:
"
f6be1abbb5abd0517522f850dd785990d373da7
e"
"Comment"
:
"v9.
1
.0"
,
"Rev"
:
"
e14a70c556c8e0db173358d1a903dca345a8e75
e"
},
{
"ImportPath"
:
"github.com/Azure/go-autorest/autorest/to"
,
"Comment"
:
"v9.
0
.0"
,
"Rev"
:
"
f6be1abbb5abd0517522f850dd785990d373da7
e"
"Comment"
:
"v9.
1
.0"
,
"Rev"
:
"
e14a70c556c8e0db173358d1a903dca345a8e75
e"
},
{
"ImportPath"
:
"github.com/Azure/go-autorest/autorest/validation"
,
"Comment"
:
"v9.
0
.0"
,
"Rev"
:
"
f6be1abbb5abd0517522f850dd785990d373da7
e"
"Comment"
:
"v9.
1
.0"
,
"Rev"
:
"
e14a70c556c8e0db173358d1a903dca345a8e75
e"
},
{
"ImportPath"
:
"github.com/MakeNowJust/heredoc"
,
...
...
vendor/github.com/Azure/go-autorest/autorest/adal/config.go
View file @
c8866ab5
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"net/url"
...
...
vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go
View file @
c8866ab5
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
This file is largely based on rjw57/oauth2device's code, with the follow differences:
* scope -> resource, and only allow a single one
...
...
vendor/github.com/Azure/go-autorest/autorest/adal/msi.go
View file @
c8866ab5
...
...
@@ -2,5 +2,19 @@
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// msiPath is the path to the MSI Extension settings file (to discover the endpoint)
var
msiPath
=
"/var/lib/waagent/ManagedIdentity-Settings"
vendor/github.com/Azure/go-autorest/autorest/adal/msi_windows.go
View file @
c8866ab5
...
...
@@ -2,6 +2,20 @@
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"os"
"strings"
...
...
vendor/github.com/Azure/go-autorest/autorest/adal/persist.go
View file @
c8866ab5
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"encoding/json"
"fmt"
...
...
vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
View file @
c8866ab5
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"net/http"
)
...
...
vendor/github.com/Azure/go-autorest/autorest/adal/token.go
View file @
c8866ab5
package
adal
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"crypto/rand"
"crypto/rsa"
...
...
vendor/github.com/Azure/go-autorest/autorest/authorization.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"net/http"
...
...
vendor/github.com/Azure/go-autorest/autorest/autorest.go
View file @
c8866ab5
...
...
@@ -57,6 +57,20 @@ generated clients, see the Client described below.
*/
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"net/http"
"time"
...
...
vendor/github.com/Azure/go-autorest/autorest/azure/BUILD
View file @
c8866ab5
...
...
@@ -6,6 +6,7 @@ go_library(
"async.go",
"azure.go",
"environments.go",
"rp.go",
],
importpath = "github.com/Azure/go-autorest/autorest/azure",
visibility = ["//visibility:public"],
...
...
vendor/github.com/Azure/go-autorest/autorest/azure/async.go
View file @
c8866ab5
package
azure
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"fmt"
...
...
vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
View file @
c8866ab5
...
...
@@ -5,6 +5,20 @@ See the included examples for more detail.
*/
package
azure
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"encoding/json"
"fmt"
...
...
@@ -165,7 +179,13 @@ func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator {
if
decodeErr
!=
nil
{
return
fmt
.
Errorf
(
"autorest/azure: error response cannot be parsed: %q error: %v"
,
b
.
String
(),
decodeErr
)
}
else
if
e
.
ServiceError
==
nil
{
e
.
ServiceError
=
&
ServiceError
{
Code
:
"Unknown"
,
Message
:
"Unknown service error"
}
// Check if error is unwrapped ServiceError
if
err
:=
json
.
Unmarshal
(
b
.
Bytes
(),
&
e
.
ServiceError
);
err
!=
nil
||
e
.
ServiceError
.
Message
==
""
{
e
.
ServiceError
=
&
ServiceError
{
Code
:
"Unknown"
,
Message
:
"Unknown service error"
,
}
}
}
e
.
RequestID
=
ExtractRequestID
(
resp
)
...
...
vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
View file @
c8866ab5
package
azure
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"strings"
...
...
vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
0 → 100644
View file @
c8866ab5
package
azure
import
(
"errors"
"fmt"
"net/http"
"net/url"
"strings"
"time"
"github.com/Azure/go-autorest/autorest"
)
// DoRetryWithRegistration tries to register the resource provider in case it is unregistered.
// It also handles request retries
func
DoRetryWithRegistration
(
client
autorest
.
Client
)
autorest
.
SendDecorator
{
return
func
(
s
autorest
.
Sender
)
autorest
.
Sender
{
return
autorest
.
SenderFunc
(
func
(
r
*
http
.
Request
)
(
resp
*
http
.
Response
,
err
error
)
{
rr
:=
autorest
.
NewRetriableRequest
(
r
)
for
currentAttempt
:=
0
;
currentAttempt
<
client
.
RetryAttempts
;
currentAttempt
++
{
err
=
rr
.
Prepare
()
if
err
!=
nil
{
return
resp
,
err
}
resp
,
err
=
autorest
.
SendWithSender
(
s
,
rr
.
Request
(),
autorest
.
DoRetryForStatusCodes
(
client
.
RetryAttempts
,
client
.
RetryDuration
,
autorest
.
StatusCodesForRetry
...
),
)
if
err
!=
nil
{
return
resp
,
err
}
if
resp
.
StatusCode
!=
http
.
StatusConflict
{
return
resp
,
err
}
var
re
RequestError
err
=
autorest
.
Respond
(
resp
,
autorest
.
ByUnmarshallingJSON
(
&
re
),
)
if
err
!=
nil
{
return
resp
,
err
}
if
re
.
ServiceError
!=
nil
&&
re
.
ServiceError
.
Code
==
"MissingSubscriptionRegistration"
{
err
=
register
(
client
,
r
,
re
)
if
err
!=
nil
{
return
resp
,
fmt
.
Errorf
(
"failed auto registering Resource Provider: %s"
,
err
)
}
}
}
return
resp
,
errors
.
New
(
"failed request and resource provider registration"
)
})
}
}
func
getProvider
(
re
RequestError
)
(
string
,
error
)
{
if
re
.
ServiceError
!=
nil
{
if
re
.
ServiceError
.
Details
!=
nil
&&
len
(
*
re
.
ServiceError
.
Details
)
>
0
{
detail
:=
(
*
re
.
ServiceError
.
Details
)[
0
]
.
(
map
[
string
]
interface
{})
return
detail
[
"target"
]
.
(
string
),
nil
}
}
return
""
,
errors
.
New
(
"provider was not found in the response"
)
}
func
register
(
client
autorest
.
Client
,
originalReq
*
http
.
Request
,
re
RequestError
)
error
{
subID
:=
getSubscription
(
originalReq
.
URL
.
Path
)
if
subID
==
""
{
return
errors
.
New
(
"missing parameter subscriptionID to register resource provider"
)
}
providerName
,
err
:=
getProvider
(
re
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"missing parameter provider to register resource provider: %s"
,
err
)
}
newURL
:=
url
.
URL
{
Scheme
:
originalReq
.
URL
.
Scheme
,
Host
:
originalReq
.
URL
.
Host
,
}
// taken from the resources SDK
// with almost identical code, this sections are easier to mantain
// It is also not a good idea to import the SDK here
// https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L252
pathParameters
:=
map
[
string
]
interface
{}{
"resourceProviderNamespace"
:
autorest
.
Encode
(
"path"
,
providerName
),
"subscriptionId"
:
autorest
.
Encode
(
"path"
,
subID
),
}
const
APIVersion
=
"2016-09-01"
queryParameters
:=
map
[
string
]
interface
{}{
"api-version"
:
APIVersion
,
}
preparer
:=
autorest
.
CreatePreparer
(
autorest
.
AsPost
(),
autorest
.
WithBaseURL
(
newURL
.
String
()),
autorest
.
WithPathParameters
(
"/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"
,
pathParameters
),
autorest
.
WithQueryParameters
(
queryParameters
),
)
req
,
err
:=
preparer
.
Prepare
(
&
http
.
Request
{})
if
err
!=
nil
{
return
err
}
req
.
Cancel
=
originalReq
.
Cancel
resp
,
err
:=
autorest
.
SendWithSender
(
client
,
req
,
autorest
.
DoRetryForStatusCodes
(
client
.
RetryAttempts
,
client
.
RetryDuration
,
autorest
.
StatusCodesForRetry
...
),
)
if
err
!=
nil
{
return
err
}
type
Provider
struct
{
RegistrationState
*
string
`json:"registrationState,omitempty"`
}
var
provider
Provider
err
=
autorest
.
Respond
(
resp
,
WithErrorUnlessStatusCode
(
http
.
StatusOK
),
autorest
.
ByUnmarshallingJSON
(
&
provider
),
autorest
.
ByClosing
(),
)
if
err
!=
nil
{
return
err
}
// poll for registered provisioning state
now
:=
time
.
Now
()
for
err
==
nil
&&
time
.
Since
(
now
)
<
client
.
PollingDuration
{
// taken from the resources SDK
// https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L45
preparer
:=
autorest
.
CreatePreparer
(
autorest
.
AsGet
(),
autorest
.
WithBaseURL
(
newURL
.
String
()),
autorest
.
WithPathParameters
(
"/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"
,
pathParameters
),
autorest
.
WithQueryParameters
(
queryParameters
),
)
req
,
err
=
preparer
.
Prepare
(
&
http
.
Request
{})
if
err
!=
nil
{
return
err
}
req
.
Cancel
=
originalReq
.
Cancel
resp
,
err
:=
autorest
.
SendWithSender
(
client
.
Sender
,
req
,
autorest
.
DoRetryForStatusCodes
(
client
.
RetryAttempts
,
client
.
RetryDuration
,
autorest
.
StatusCodesForRetry
...
),
)
if
err
!=
nil
{
return
err
}
err
=
autorest
.
Respond
(
resp
,
WithErrorUnlessStatusCode
(
http
.
StatusOK
),
autorest
.
ByUnmarshallingJSON
(
&
provider
),
autorest
.
ByClosing
(),
)
if
err
!=
nil
{
return
err
}
if
provider
.
RegistrationState
!=
nil
&&
*
provider
.
RegistrationState
==
"Registered"
{
break
}
delayed
:=
autorest
.
DelayWithRetryAfter
(
resp
,
originalReq
.
Cancel
)
if
!
delayed
{
autorest
.
DelayForBackoff
(
client
.
PollingDelay
,
0
,
originalReq
.
Cancel
)
}
}
if
!
(
time
.
Since
(
now
)
<
client
.
PollingDuration
)
{
return
errors
.
New
(
"polling for resource provider registration has exceeded the polling duration"
)
}
return
err
}
func
getSubscription
(
path
string
)
string
{
parts
:=
strings
.
Split
(
path
,
"/"
)
for
i
,
v
:=
range
parts
{
if
v
==
"subscriptions"
&&
(
i
+
1
)
<
len
(
parts
)
{
return
parts
[
i
+
1
]
}
}
return
""
}
vendor/github.com/Azure/go-autorest/autorest/client.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"fmt"
...
...
@@ -33,7 +47,8 @@ var (
Version
(),
)
statusCodesForRetry
=
[]
int
{
// StatusCodesForRetry are a defined group of status code for which the client will retry
StatusCodesForRetry
=
[]
int
{
http
.
StatusRequestTimeout
,
// 408
http
.
StatusTooManyRequests
,
// 429
http
.
StatusInternalServerError
,
// 500
...
...
@@ -187,8 +202,7 @@ func (c Client) Do(r *http.Request) (*http.Response, error) {
if
err
!=
nil
{
return
nil
,
NewErrorWithError
(
err
,
"autorest/Client"
,
"Do"
,
nil
,
"Preparing request failed"
)
}
resp
,
err
:=
SendWithSender
(
c
.
sender
(),
r
,
DoRetryForStatusCodes
(
c
.
RetryAttempts
,
c
.
RetryDuration
,
statusCodesForRetry
...
))
resp
,
err
:=
SendWithSender
(
c
.
sender
(),
r
)
Respond
(
resp
,
c
.
ByInspecting
())
return
resp
,
err
...
...
vendor/github.com/Azure/go-autorest/autorest/date/date.go
View file @
c8866ab5
...
...
@@ -5,6 +5,20 @@ time.Time types. And both convert to time.Time through a ToTime method.
*/
package
date
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"time"
...
...
vendor/github.com/Azure/go-autorest/autorest/date/time.go
View file @
c8866ab5
package
date
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"regexp"
"time"
...
...
vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go
View file @
c8866ab5
package
date
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"errors"
"time"
...
...
vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go
View file @
c8866ab5
package
date
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"encoding/binary"
...
...
vendor/github.com/Azure/go-autorest/autorest/date/utility.go
View file @
c8866ab5
package
date
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"strings"
"time"
...
...
vendor/github.com/Azure/go-autorest/autorest/error.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"net/http"
...
...
vendor/github.com/Azure/go-autorest/autorest/preparer.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"encoding/json"
...
...
vendor/github.com/Azure/go-autorest/autorest/responder.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"encoding/json"
...
...
vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"io"
...
...
vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go
View file @
c8866ab5
// +build !go1.8
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package
autorest
import
(
"bytes"
"io/ioutil"
"net/http"
)
// RetriableRequest provides facilities for retrying an HTTP request.
type
RetriableRequest
struct
{
req
*
http
.
Request
br
*
bytes
.
Reader
reset
bool
req
*
http
.
Request
br
*
bytes
.
Reader
}
// Prepare signals that the request is about to be sent.
...
...
@@ -19,21 +33,17 @@ func (rr *RetriableRequest) Prepare() (err error) {
// preserve the request body; this is to support retry logic as
// the underlying transport will always close the reqeust body
if
rr
.
req
.
Body
!=
nil
{
if
rr
.
reset
{
if
rr
.
br
!=
nil
{
_
,
err
=
rr
.
br
.
Seek
(
0
,
0
/*io.SeekStart*/
)
}
rr
.
reset
=
false
if
err
!=
nil
{
return
err
}
if
rr
.
br
!=
nil
{
_
,
err
=
rr
.
br
.
Seek
(
0
,
0
/*io.SeekStart*/
)
rr
.
req
.
Body
=
ioutil
.
NopCloser
(
rr
.
br
)
}
if
err
!=
nil
{
return
err
}
if
rr
.
br
==
nil
{
// fall back to making a copy (only do this once)
err
=
rr
.
prepareFromByteReader
()
}
// indicates that the request body needs to be reset
rr
.
reset
=
true
}
return
err
}
...
...
vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go
View file @
c8866ab5
// +build go1.8
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package
autorest
import
(
"bytes"
"io"
"io/ioutil"
"net/http"
)
// RetriableRequest provides facilities for retrying an HTTP request.
type
RetriableRequest
struct
{
req
*
http
.
Request
rc
io
.
ReadCloser
br
*
bytes
.
Reader
reset
bool
req
*
http
.
Request
rc
io
.
ReadCloser
br
*
bytes
.
Reader
}
// Prepare signals that the request is about to be sent.
...
...
@@ -21,16 +35,14 @@ func (rr *RetriableRequest) Prepare() (err error) {
// preserve the request body; this is to support retry logic as
// the underlying transport will always close the reqeust body
if
rr
.
req
.
Body
!=
nil
{
if
rr
.
reset
{
if
rr
.
rc
!=
nil
{
rr
.
req
.
Body
=
rr
.
rc
}
else
if
rr
.
br
!=
nil
{
_
,
err
=
rr
.
br
.
Seek
(
0
,
io
.
SeekStart
)
}
rr
.
reset
=
false
if
err
!=
nil
{
return
err
}
if
rr
.
rc
!=
nil
{
rr
.
req
.
Body
=
rr
.
rc
}
else
if
rr
.
br
!=
nil
{
_
,
err
=
rr
.
br
.
Seek
(
0
,
io
.
SeekStart
)
rr
.
req
.
Body
=
ioutil
.
NopCloser
(
rr
.
br
)
}
if
err
!=
nil
{
return
err
}
if
rr
.
req
.
GetBody
!=
nil
{
// this will allow us to preserve the body without having to
...
...
@@ -43,8 +55,6 @@ func (rr *RetriableRequest) Prepare() (err error) {
// fall back to making a copy (only do this once)
err
=
rr
.
prepareFromByteReader
()
}
// indicates that the request body needs to be reset
rr
.
reset
=
true
}
return
err
}
...
...
vendor/github.com/Azure/go-autorest/autorest/sender.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"log"
...
...
vendor/github.com/Azure/go-autorest/autorest/to/convert.go
View file @
c8866ab5
...
...
@@ -3,6 +3,20 @@ Package to provides helpers to ease working with pointer values of marshalled st
*/
package
to
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// String returns a string value for the passed string pointer. It returns the empty string if the
// pointer is nil.
func
String
(
s
*
string
)
string
{
...
...
vendor/github.com/Azure/go-autorest/autorest/utility.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"encoding/json"
...
...
vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
View file @
c8866ab5
...
...
@@ -3,6 +3,20 @@ Package validation provides methods for validating parameter value using reflect
*/
package
validation
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"fmt"
"reflect"
...
...
@@ -91,15 +105,12 @@ func validateStruct(x reflect.Value, v Constraint, name ...string) error {
return
createError
(
x
,
v
,
fmt
.
Sprintf
(
"field %q doesn't exist"
,
v
.
Target
))
}
if
err
:=
Validate
([]
Validation
{
return
Validate
([]
Validation
{
{
TargetValue
:
getInterfaceValue
(
f
),
Constraints
:
[]
Constraint
{
v
},
},
});
err
!=
nil
{
return
err
}
return
nil
})
}
func
validatePtr
(
x
reflect
.
Value
,
v
Constraint
)
error
{
...
...
vendor/github.com/Azure/go-autorest/autorest/version.go
View file @
c8866ab5
package
autorest
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
(
"bytes"
"fmt"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment