Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrInvalidJSON = "invalid_json" ErrInvalidRequestURL = "invalid_request_url" ErrInvalidRequest = "invalid_request" ErrValidationError = "validation_error" ErrMissingVersion = "missing_version" ErrRestrictedResource = "restricted_resource" ErrObjectNotFound = "object_not_found" ErrConflictError = "conflict_error" ErrRateLimited = "rate_limited" ErrInternalServerError = "internal_server_error" ErrGatewayTimeout = "gateway_timeout" )
Notion API error codes.
Variables ¶
This section is empty.
Functions ¶
func IsRetryable ¶
IsRetryable reports whether the error represents a retryable condition.
func ParseError ¶
ParseError extracts an APIError from a resty response. Returns nil if the response indicates success (2xx).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps resty for Notion API calls with rate limiting and retry.
type PageIterator ¶
type PageIterator struct {
// contains filtered or unexported fields
}
PageIterator provides cursor-based pagination over Notion list endpoints.
func NewPageIterator ¶
func NewPageIterator(client *Client, path string, body map[string]interface{}) *PageIterator
NewPageIterator creates an iterator for a POST-based paginated endpoint. body can be nil for endpoints with no request body.
func (*PageIterator) HasMore ¶
func (p *PageIterator) HasMore() bool
HasMore reports whether more pages remain.
func (*PageIterator) Next ¶
func (p *PageIterator) Next() ([]byte, error)
Next fetches the next page of results as raw JSON bytes. Returns nil, nil when no more pages.
Click to show internal directories.
Click to hide internal directories.