| package utils | |
| import ( | |
| "crypto/tls" | |
| "time" | |
| "github.com/go-resty/resty/v2" | |
| ) | |
| var ( | |
| RestyClient = newRestyClient() | |
| ) | |
| func newRestyClient() *resty.Client { | |
| client := resty.New() | |
| client.SetDisableWarn(true) | |
| client.SetTimeout(10 * time.Second) | |
| client.SetRetryCount(3) | |
| client.SetRetryWaitTime(2 * time.Second) | |
| client.SetRetryMaxWaitTime(10 * time.Second) | |
| client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) | |
| return client | |
| } | |