Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleErrorResponse ¶
HandleErrorResponse checks an HTTP response for errors and returns a user-friendly error.
Types ¶
type AuthExpiredError ¶ added in v0.5.1
type AuthExpiredError struct {
Detail string
}
AuthExpiredError indicates the API token is invalid, expired, or revoked. Detail preserves the original API response body for debugging.
func (*AuthExpiredError) Error ¶ added in v0.5.1
func (e *AuthExpiredError) Error() string
type Client ¶
type Client struct {
HTTPClient *http.Client
RateLimiter *RateLimiter
// contains filtered or unexported fields
}
Client provides authenticated access to the ClickUp API with rate limiting.
func NewTestClient ¶ added in v0.21.0
NewTestClient creates a Client that routes all requests to the given base URL (typically an httptest.Server). Used in tests to avoid hitting the real ClickUp API.
func (*Client) BaseURL ¶ added in v0.21.0
BaseURL returns the base API URL. For production this is "https://api.clickup.com/api/v2"; for tests it points to httptest.Server.
func (*Client) BaseURLV3 ¶ added in v0.22.0
BaseURLV3 returns the base URL for the ClickUp v3 API. For production this is "https://api.clickup.com/api/v3"; for tests it derives from the test server by replacing "/api/v2" with "/api/v3".
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter tracks ClickUp API rate limits and provides backoff.
func (*RateLimiter) ShouldRetry ¶
func (rl *RateLimiter) ShouldRetry(resp *http.Response) bool
ShouldRetry returns true if the response indicates rate limiting and the request should be retried.
func (*RateLimiter) Update ¶
func (rl *RateLimiter) Update(resp *http.Response)
Update reads rate limit headers from a response.
func (*RateLimiter) Wait ¶
func (rl *RateLimiter) Wait()
Wait blocks until it's safe to make another request.