Expand description
HTTP loader (http feature).
Fetches configuration bytes through a user-provided closure so this crate does not depend on
any HTTP client library. You supply the actual transport (via Http::new); the loader
validates options, invokes your closure, and normalizes the returned entries.
Source: http (the resource is the URL and is required; an empty resource is rejected
with Error::InvalidResource)
§Behaviour
- The
headers,timeout, andinsecureoptions are validated here, then passed to your fetch closure — enforcing them (timeouts, TLS policy) is the closure’s responsibility. - Whatever
Payloads the closure returns are post-processed:maybe_nameandmaybe_formatare trimmed, emptied toNone, and lower-cased whenlowercase = true(the default). - If the closure returns an error it is wrapped as
Error::Loadwith description"fetch configuration".
§Options
headers— map of string headers (default{})timeout— positive integer seconds (default15)insecure— allow invalid TLS certificates (defaultfalse)lowercase— boolean (defaulttrue; whether to lowercase entry names and formats)
§Example
http(headers=(Authorization="TOKEN"),timeout=30,insecure=true):https://example.com/config.ymlStructs§
- Http
- Loader for the
httpsource: fetches configuration bytes through a user-supplied closure.
Constants§
Type Aliases§
- Http
Fetch Fn - The transport closure driving an
Httploader — you implement the actual request here.