Documentation
¶
Overview ¶
Package httpclient is a minimal JSON HTTP client vendored into the engine so the fh-backend capability implementation has no dependency on the closed fh-backend module. It mirrors the small surface the backend client used: NewClient(baseURL, authHeader, authValue) + Do(ctx, ...).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a JSON-over-HTTP client that attaches a fixed auth header to every request.
func NewClient ¶
NewClient builds a Client. authHeader/authValue are sent on every request (e.g. "Agent-Key", <secret>); pass "" for authHeader to disable auth.
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, method, path string, query url.Values, body, out any) error
Do executes method baseURL+path. body, when non-nil, is JSON-encoded as the request body. out, when non-nil, receives the JSON-decoded response. A non-2xx status returns an error carrying the status and response snippet. Per-call deadlines come from ctx (callers wrap with context.WithTimeout).