View Source Mobilizon.Service.Pictures.Provider behaviour (Mobilizon v5.0.0-beta.1)
Provider Behaviour for pictures stuff.
Supported backends
Mobilizon.Service.Pictures.Unsplash
🔗Mobilizon.Service.Pictures.Flickr
🔗
Shared options
:lang
Lang in which to prefer results. Used as a request parameter or through anAccept-Language
HTTP header. Defaults to"en"
.:country_code
An ISO 3166 country code. String ornil
:limit
Maximum limit for the number of results returned by the backend. Defaults to10
:api_key
Allows to override the API key (if the backend requires one) set inside the configuration.:endpoint
Allows to override the endpoint set inside the configuration.
Summary
Callbacks
@callback csp() :: keyword()
The CSP configuration to add for the service to work
@callback search(location :: String.t(), options :: keyword()) :: Mobilizon.Service.Pictures.Information.t()
Get a picture for a location
Examples
iex> search("London")
%Information{url: "https://some_url_to.a/picture.jpeg", author: %{name: "An author", url: "https://url.to/profile"}, source: %{name: "The source name", url: "The source URL" }}