Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBodyTooLarge indicates the HTTP response body exceeded the configured max size. ErrBodyTooLarge = errors.New("http provider: body too large") )
Functions ¶
func IsRemoteURL ¶
IsRemoteURL reports whether the given path is a remote HTTP(S) URL.
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP provides configuration bytes fetched from an HTTP(S) endpoint. Required: URL. Optional: headers, timeout, custom client, HTTP method.
type Option ¶
type Option func(*options)
Option configures optional behavior for the HTTP provider.
func WithClient ¶
WithClient sets a custom HTTP client. When provided, it takes precedence over WithTimeout. The provided client will be used as-is.
func WithHeader ¶
WithHeader adds or overrides a single request header.
func WithHeaders ¶
WithHeaders merges multiple headers into the request headers.
func WithMaxBodySize ¶
WithMaxBodySize limits the maximum response body size in bytes. If the response exceeds this size, Read returns ErrBodyTooLarge. A non-positive value disables the limit.
func WithTimeout ¶
WithTimeout sets a client-level timeout for requests when using the internally created http.Client. Default: no timeout (0). Prefer controlling request deadlines with context (e.g., context.WithTimeout). If a custom client is supplied via WithClient, this option is ignored.