api

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleErrorResponse

func HandleErrorResponse(resp *http.Response) error

HandleErrorResponse checks an HTTP response for errors and returns a user-friendly error.

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
	Err        string
}

APIError represents an error returned by the ClickUp API.

func (*APIError) Error

func (e *APIError) Error() string

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 {
	Clickup     *clickup.Client
	HTTPClient  *http.Client
	RateLimiter *RateLimiter
	// contains filtered or unexported fields
}

Client wraps the go-clickup client with auth and rate limiting.

func NewClient

func NewClient(token string) *Client

NewClient creates a new API client with the given token.

func (*Client) DoRequest

func (c *Client) DoRequest(req *http.Request) (*http.Response, error)

DoRequest makes a raw HTTP request to the ClickUp API.

func (*Client) Token

func (c *Client) Token() string

Token returns the API token used by this client.

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter tracks ClickUp API rate limits and provides backoff.

func NewRateLimiter

func NewRateLimiter() *RateLimiter

NewRateLimiter creates a new rate limiter.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL