Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DataClient = NewDataClient()
DataClient is for fetching operator-configured data sources and posting to operator-configured destinations.
It bounds the phases that must be fast — connecting, the TLS handshake, and waiting for the server to begin its reply — but deliberately does not cap the total duration of a request. A data pipeline legitimately downloads large files and uploads large batches, and an overall Timeout would abort those on a clock rather than on a fault. This is the same distinction the API server makes between ReadHeaderTimeout and ReadTimeout: bound the wait, not the work.
It also deliberately performs NO SSRF check, which is what separates it from DefaultClient. Hermod is self-hosted, and a source pointed at http://internal-api.local is an ordinary thing to configure; refusing private addresses here would break the deployments this software exists for. Use DefaultClient instead whenever the thing being fetched is code, or comes from somewhere the operator does not control.
var DefaultClient = NewSecureClient(10 * time.Second)
DefaultClient is a pre-configured secure and performant HTTP client.
Functions ¶
func IsIPPrivate ¶
IsIPPrivate reports whether the given IP address is in a private/local range.
func NewDataClient ¶
NewDataClient builds the client described by DataClient.
func NewSecureClient ¶
NewSecureClient returns an http.Client with reasonable timeouts and basic SSRF protection by preventing connections to local/private IP ranges.
Types ¶
This section is empty.