Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change *http.Transport to http.RoundTripper #123

Merged
merged 1 commit into from
Feb 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ rmqc, err := NewTLSClient("https://127.0.0.1:15672", "guest", "guest", transport
### Changing Transport Layer

``` go
var transport *http.Transport
var transport http.RoundTripper

...

Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Client struct {
// Password to use.
Password string
host string
transport *http.Transport
transport http.RoundTripper
timeout time.Duration
}

Expand All @@ -38,7 +38,7 @@ func NewClient(uri string, username string, password string) (me *Client, err er
}

// Creates a client with a transport; it is up to the developer to make that layer secure.
func NewTLSClient(uri string, username string, password string, transport *http.Transport) (me *Client, err error) {
func NewTLSClient(uri string, username string, password string, transport http.RoundTripper) (me *Client, err error) {
u, err := url.Parse(uri)
if err != nil {
return nil, err
Expand All @@ -56,7 +56,7 @@ func NewTLSClient(uri string, username string, password string, transport *http.
}

//SetTransport changes the Transport Layer that the Client will use.
func (c *Client) SetTransport(transport *http.Transport) {
func (c *Client) SetTransport(transport http.RoundTripper) {
c.transport = transport
}

Expand Down