Skip to content

Commit

Permalink
internal/redfishwrapper: add methods to override the HTTP client time…
Browse files Browse the repository at this point in the history
…out value
  • Loading branch information
joelrebel committed Jul 14, 2023
1 parent 13adab0 commit 7eddbde
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/redfishwrapper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ func (c *Client) SessionActive() error {
return nil
}

// Overrides the HTTP client timeout
func (c *Client) SetHttpClientTimeout(t time.Duration) {
c.client.HTTPClient.Timeout = t
}

// retrieve the current HTTP client timeout
func (c *Client) HttpClientTimeout() time.Duration {
return c.client.HTTPClient.Timeout
}

// RunRawRequestWithHeaders wraps the gofish client method RunRawRequestWithHeaders
func (c *Client) RunRawRequestWithHeaders(method, url string, payloadBuffer io.ReadSeeker, contentType string, customHeaders map[string]string) (*http.Response, error) {
if err := c.SessionActive(); err != nil {
Expand Down

0 comments on commit 7eddbde

Please sign in to comment.