Smee.Fetch (Smee v0.1.0) View Source
Downloads or loads the metadata specified in a %Smee.Source{}
struct and returns a %Smee.Metadata{}
struct.
The fetch!/2
and fetch/2
functions can handle both remote and local sources, but sometimes it can be
reassuring to prevent unexpected behaviour (perhaps if using a source defined by a user) so Smee.Fetch
also
contains local!/2
and remote!/2
which will each only accept certain types of sources.
This module will do the work of creating suitable Metadata structs for you, so you should not normally need to create Metadata structs directly yourself.
Link to this section Summary
Functions
Uses the passed Source struct to load or download the requested metadata XML, and returns a Metadata struct containing the XML.
Uses the passed Source struct to load the requested metadata XML, and returns a Metadata struct containing the XML
Uses the passed Source struct to download the requested metadata XML, and returns a Metadata struct containing the XML in an :ok/:error tuple.
Uses the passed Source struct to download the requested metadata XML, and returns a Metadata struct containing the XML
Link to this section Functions
Specs
fetch!(source :: Smee.Source.t(), options :: keyword()) :: Smee.Metadata.t()
Uses the passed Source struct to load or download the requested metadata XML, and returns a Metadata struct containing the XML.
Works with all types of Source, even MDQ services.
Will raise an exception on any errors.
Specs
local!(source :: Smee.Source.t(), options :: keyword()) :: Smee.Metadata.t()
Uses the passed Source struct to load the requested metadata XML, and returns a Metadata struct containing the XML
Works with local Sources including MDQ services but will not accept metadata at a remote URL.
Will raise an exception on any errors.
Specs
remote(source :: Smee.Source.t(), options :: keyword()) :: {:ok, Smee.Metadata.t()} | {:error, binary()}
Uses the passed Source struct to download the requested metadata XML, and returns a Metadata struct containing the XML in an :ok/:error tuple.
Works with remote Sources including MDQ services but will not accept metadata in a local file.
Specs
remote!(source :: Smee.Source.t(), options :: keyword()) :: Smee.Metadata.t()
Uses the passed Source struct to download the requested metadata XML, and returns a Metadata struct containing the XML
Works with remote Sources including MDQ services but will not accept metadata in a local file.
Will raise an exception on any errors.