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

Add set retry timeout interface #240

Merged
merged 2 commits into from
Nov 20, 2023
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
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