4
0
Эх сурвалжийг харах

Expose a way to update the transport.

Mariano Cano 7 жил өмнө
parent
commit
888ef147fa
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      ca/client.go

+ 5 - 0
ca/client.go

@@ -258,6 +258,11 @@ func NewClient(endpoint string, opts ...ClientOption) (*Client, error) {
 	}, nil
 	}, nil
 }
 }
 
 
+// SetTransport updates the transport of the internal HTTP client.
+func (c *Client) SetTransport(tr http.RoundTripper) {
+	c.client.Transport = tr
+}
+
 // Health performs the health request to the CA and returns the
 // Health performs the health request to the CA and returns the
 // api.HealthResponse struct.
 // api.HealthResponse struct.
 func (c *Client) Health() (*api.HealthResponse, error) {
 func (c *Client) Health() (*api.HealthResponse, error) {