mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-09 12:27:47 +00:00
1.4 KiB
1.4 KiB
id, title, pagination_label, sidebar_label, sidebar_position, sidebar_class_name, keywords, description, slug, tags
| id | title | pagination_label | sidebar_label | sidebar_position | sidebar_class_name | keywords | description | slug | tags | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| go-sdk-retries | Retries with the Go SDK | Go SDK | Retries | 7 | gosdk |
|
Learn how to paginate results with the Golang SDK in this guide. | /tools/sdk/go/retries |
|
The SDK uses the go-retryablehttp module to support retry logic.
On line 17-18 of the following example, the SDK is set to retry if there is an unexpected error up to 10 times and wait 2 seconds between each retry:
package main
import (
"context"
"fmt"
"os"
sailpoint "github.com/sailpoint-oss/golang-sdk"
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
)
func main() {
ctx := context.TODO()
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
configuration.HTTPClient.RetryMax = 10
configuration.HTTPClient.RetryWaitMax = time.Second * 2
resp, r, err := apiClient.V3.TransformsAPI.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TransformsApi.ListTransforms``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAccounts`: []Account
fmt.Fprintf(os.Stdout, "First response from `TransformsApi.ListTransforms`: %v\n", resp)
}