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
69b28ce7
Commit
69b28ce7
authored
Jan 21, 2016
by
Alex Mohr
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19892 from krousey/rtwrap
Add WrappedRoundTripper methods to round trippers
parents
4ac2f745
8cc483dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
round_trippers.go
pkg/client/transport/round_trippers.go
+10
-0
No files found.
pkg/client/transport/round_trippers.go
View file @
69b28ce7
...
@@ -97,6 +97,8 @@ func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) {
...
@@ -97,6 +97,8 @@ func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) {
}
}
}
}
func
(
rt
*
userAgentRoundTripper
)
WrappedRoundTripper
()
http
.
RoundTripper
{
return
rt
.
rt
}
type
basicAuthRoundTripper
struct
{
type
basicAuthRoundTripper
struct
{
username
string
username
string
password
string
password
string
...
@@ -126,6 +128,8 @@ func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) {
...
@@ -126,6 +128,8 @@ func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) {
}
}
}
}
func
(
rt
*
basicAuthRoundTripper
)
WrappedRoundTripper
()
http
.
RoundTripper
{
return
rt
.
rt
}
type
bearerAuthRoundTripper
struct
{
type
bearerAuthRoundTripper
struct
{
bearer
string
bearer
string
rt
http
.
RoundTripper
rt
http
.
RoundTripper
...
@@ -155,6 +159,8 @@ func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) {
...
@@ -155,6 +159,8 @@ func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) {
}
}
}
}
func
(
rt
*
bearerAuthRoundTripper
)
WrappedRoundTripper
()
http
.
RoundTripper
{
return
rt
.
rt
}
// cloneRequest returns a clone of the provided *http.Request.
// cloneRequest returns a clone of the provided *http.Request.
// The clone is a shallow copy of the struct and its Header map.
// The clone is a shallow copy of the struct and its Header map.
func
cloneRequest
(
r
*
http
.
Request
)
*
http
.
Request
{
func
cloneRequest
(
r
*
http
.
Request
)
*
http
.
Request
{
...
@@ -293,3 +299,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
...
@@ -293,3 +299,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
return
response
,
err
return
response
,
err
}
}
func
(
rt
*
debuggingRoundTripper
)
WrappedRoundTripper
()
http
.
RoundTripper
{
return
rt
.
delegatedRoundTripper
}
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