You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 3, 2024. It is now read-only.
resp.Diagnostics.AddError("Error waiting for rate limit", fmt.Sprintf("There was an error while awaiting a slot from the rate limiter: %s", err))
141
+
}
142
+
124
143
httpResp, err:=client.Do(httpReq)
125
144
iferr!=nil {
126
-
log.Printf("HTTP Client Error 🚨: %s", err)
145
+
log.Printf("HTTP client error 🚨: %s", err)
127
146
resp.Diagnostics.AddError("Error fetching information from the IP information provider", fmt.Sprintf("There was an error when contacting '%s': %s", requestURLstr, err))
resp.Diagnostics.AddError("Unable to parse the rate_limit_rate", fmt.Sprintf("The rate_limit_rate value '%s' can't be parsed: %s", rateLimitRate, err))
114
+
returnfalse
115
+
}
116
+
117
+
varrateLimitBurstint
118
+
ifdata.RateLimitBurst.Null {
119
+
rateLimitBurst=DefaultRateLimitBurst
120
+
} elseifdata.RateLimitBurst.Value>math.MaxInt {
121
+
resp.Diagnostics.AddError("Unable to use the rate_limit_burst", fmt.Sprintf("The rate_limit_burst value '%d' is too big. Maximum allowed is %d", data.RateLimitBurst.Value, math.MaxInt))
122
+
returnfalse
123
+
} elseifdata.RateLimitBurst.Value<=0 {
124
+
resp.Diagnostics.AddError("Unable to use the rate_limit_burst", fmt.Sprintf("The rate_limit_burst value '%d' must be bigger than 0", data.RateLimitBurst.Value))
MarkdownDescription: fmt.Sprintf("Timeout of the request to the IP information provider, defaults to `%s`.", DefaultTimeout),
149
+
MarkdownDescription: fmt.Sprintf("Timeout of the request to the IP information provider. Defaults to `%s`.", DefaultTimeout),
99
150
Optional: true,
100
151
Type: types.StringType,
101
152
},
153
+
"rate_limit_rate": {
154
+
MarkdownDescription: fmt.Sprintf("Limit the number of the request to the IP information provider. Defines the time until the limit is reset. Defaults to `%s`.", DefaultRateLimitRate),
155
+
Optional: true,
156
+
Type: types.StringType,
157
+
},
158
+
"rate_limit_burst": {
159
+
MarkdownDescription: fmt.Sprintf("Limit the number of the request to the IP information provider. Defines the number of events per rate until the limit is reached. Defaults to `%d`.", DefaultRateLimitBurst),
160
+
Optional: true,
161
+
Type: types.Int64Type,
162
+
},
102
163
"provider_url": {
103
164
MarkdownDescription: fmt.Sprintf("URL to a ifconfig.co-compatible IP information provider, defaults to `%s`.", DefaultProviderURL),
0 commit comments