Smee.Source (Smee v0.1.0) View Source
Defines sources for metadata, which can then be Fetch
ed and prodoce Metadata structs. Source structs are the
usual starting-place for Smee tasks.
Source structs act as the configuration for metadata creation. They require a URL but various other options can be set and their effect will propagate down to Entity records.
Link to this section Summary
Functions
Attempts to validate a source struct, and will return an :ok/:error tuple containing the Source if it passes checks.
Attempts to validate a source struct, and will return the Source if it passes checks, or raise an exception.
Creates a new source struct, describing where and how to find metadata.
Link to this section Types
Specs
Link to this section Functions
Specs
Attempts to validate a source struct, and will return an :ok/:error tuple containing the Source if it passes checks.
Specs
Attempts to validate a source struct, and will return the Source if it passes checks, or raise an exception.
Specs
Creates a new source struct, describing where and how to find metadata.
The only essential parameter is a URL for the metadata. URLs can have file:
, http://
, or https://
schemes.
Bare filesystem paths can also be passed and will be converted to file:
URLs.
MDQ service clients should be configured with the base URL of the service, not the /entity/
endpoint, and a
type of :mdq. Alternatively the Smee.MDQ.source/2
function can be used as a shortcut.
Available options include:
- type: determines the general type of metadata - :aggregate (the default), :single and :mdq
- cert_url: location of certificate to use when verifying signed metadata
- cert_fingerprint: SHA1 fingerprint of the signing certificate
- cache: should HTTP caching be enabled for downloads. true or false, defaults to true.
- redirects: maximum number of 302 redirects to follow
- retries: number of retries to attempt
- label: a relatively useless label for the metadata
- priority: integer between 0 and 9, used for comparing metadata
- trustiness: float between 0.0 and 0.9, for comparing metadata
- strict: defaults to false. If enabled some stricter checks are enabled
MDQ sources are intended for use with the Smee.MDQ
API but will also support normal fetch requests.