Documentation
¶
Overview ¶
Package apiclient provides an HTTP client for the SCANOSS REST API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnauthorized = errors.New("unauthorized: invalid API key") // ErrForbidden indicates access is denied (403). ErrForbidden = errors.New("forbidden: access denied") // ErrNotFound indicates the requested resource was not found (404). ErrNotFound = errors.New("not found: resource does not exist") // ErrServerError indicates a server-side error (500+). ErrServerError = errors.New("server error: please try again later") // ErrTimeout indicates a request timeout. ErrTimeout = errors.New("request timeout") // ErrInvalidChecksum indicates the downloaded content checksum doesn't match. ErrInvalidChecksum = errors.New("checksum verification failed") )
Functions ¶
func IsRetryable ¶
IsRetryable returns true if the error should be retried.
func IsServerError ¶
IsServerError returns true if the error is a server error (5xx).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client for the SCANOSS REST API.
func NewClientWithHTTPClient ¶ added in v0.4.0
NewClientWithHTTPClient creates a new API client with an optional custom HTTP client.
type HTTPError ¶
HTTPError wraps HTTP-specific errors with status code and message.
func NewHTTPError ¶
NewHTTPError creates a new HTTP error.
Click to show internal directories.
Click to hide internal directories.