Documentation
¶
Overview ¶
Package httputil provides shared HTTP helper utilities used across multiple HTTP-facing packages (server, proxy, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTransientHTTPError ¶ added in v0.2.25
IsTransientHTTPError returns true for status codes that indicate a temporary server-side condition (rate-limiting or transient failure) worth retrying.
func ParseRateLimitResetHeader ¶ added in v0.2.20
ParseRateLimitResetHeader parses the Unix-timestamp value of the X-RateLimit-Reset HTTP header into a time.Time. Returns zero time when the header value is absent or malformed.
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, statusCode int, body interface{})
WriteJSONResponse sets the Content-Type header, writes the status code, and encodes body as JSON. It centralises the three-line pattern used across HTTP handlers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.