Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HttpClient = &http.Client{ Timeout: 10 * time.Second, }
Functions ¶
func Fetch ¶
Fetch fetches the response body from a given URL after validating it. If the URL scheme is "file", the file is fetched from the local filesystem. If the URL scheme is "http", "https", or "ftp", the file is fetched from the remote server. If the URL has a checksum, the file is validated against the checksum.
func FetchLocalFile ¶
FetchLocalFile fetches a local file from a given URL. If the URL scheme is not "file", an error is returned. If the URL is relative, the component definition directory is prepended if set, otherwise the current working directory is prepended.
func ParseChecksum ¶
ParseChecksum parses a URL string into a url.URL object. If the URL has a checksum, the checksum is removed from the URL and returned.
func ValidateChecksum ¶
ValidateChecksum validates a given checksum against a given []bytes. Supports MD5, SHA-1, SHA-256, and SHA-512. Returns an error if the hash does not match.
Types ¶
This section is empty.