Documentation
¶
Overview ¶
Package httpclient provides a low-level HTTP client with configurable retry behaviour. It is the transport layer beneath internal/api and has no knowledge of Aura-specific concepts such as base URLs, API versions, or authentication.
Index ¶
Constants ¶
const (
// DefaultMaxResponseSize is the maximum size of response body to read (10MB).
DefaultMaxResponseSize = 10 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPResponse ¶
HTTPResponse stores the response from a request, including the payload and headers.
type HTTPService ¶
type HTTPService interface {
Get(ctx context.Context, url string, headers map[string]string) (*HTTPResponse, error)
Post(ctx context.Context, url string, headers map[string]string, body string) (*HTTPResponse, error)
Put(ctx context.Context, url string, headers map[string]string, body string) (*HTTPResponse, error)
Patch(ctx context.Context, url string, headers map[string]string, body string) (*HTTPResponse, error)
Delete(ctx context.Context, url string, headers map[string]string) (*HTTPResponse, error)
}
HTTPService defines the interface for HTTP operations. This is the low-level HTTP layer that handles raw HTTP requests.
func NewHTTPService ¶
NewHTTPService creates a new HTTPService backed by a retryable HTTP client. Retries are attempted only on network-level errors (no response received); HTTP error responses (including 5xx) are always returned to the caller. The caller-supplied logger is used for debug output.