()
| 42 | } |
| 43 | |
| 44 | func (e *Error) Error() string { |
| 45 | switch e.Kind { |
| 46 | case ErrorKindPermanent: |
| 47 | return "all configured keys failed authentication" |
| 48 | case ErrorKindRateLimited: |
| 49 | return fmt.Sprintf("all configured keys are rate-limited (retry after %s)", e.RetryAfter) |
| 50 | default: |
| 51 | return "key pool error" |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // KeyState represents the current state of a key in the pool. |
| 56 | type KeyState int |
no outgoing calls