Skip to content

Commit

Permalink
Merge pull request #240 from crimson-gao/addTimeout
Browse files Browse the repository at this point in the history
Add set retry timeout interface
  • Loading branch information
crimson-gao authored Nov 20, 2023
2 parents 4369a3b + f5fd0c7 commit f9971c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ func (c *Client) SetHTTPClient(client *http.Client) {
c.HTTPClient = client
}

// SetRetryTimeout set retry timeout
func (c *Client) SetRetryTimeout(timeout time.Duration) {
c.RetryTimeOut = timeout
}

// SetAuthVersion set signature version that the client used
func (c *Client) SetAuthVersion(version AuthVersionType) {
c.accessKeyLock.Lock()
Expand Down
2 changes: 2 additions & 0 deletions client_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ type ClientInterface interface {
SetUserAgent(userAgent string)
// SetHTTPClient set a custom http client, all request will send to sls by this client
SetHTTPClient(client *http.Client)
// SetRetryTimeout set retry timeout, client will retry util retry timeout
SetRetryTimeout(timeout time.Duration)
// #################### Client Operations #####################
// ResetAccessKeyToken reset client's access key token
ResetAccessKeyToken(accessKeyID, accessKeySecret, securityToken string)
Expand Down
5 changes: 5 additions & 0 deletions token_auto_update_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ func (c *TokenAutoUpdateClient) SetHTTPClient(client *http.Client) {
c.logClient.SetHTTPClient(client)
}

// SetRetryTimeout set retry timeout
func (c *TokenAutoUpdateClient) SetRetryTimeout(timeout time.Duration) {
c.logClient.SetRetryTimeout(timeout)
}

// SetAuthVersion set auth version that the client used
func (c *TokenAutoUpdateClient) SetAuthVersion(version AuthVersionType) {
c.logClient.SetAuthVersion(version)
Expand Down

0 comments on commit f9971c5

Please sign in to comment.