farmbot v6.0.1-alpha Farmbot.HTTP.Adapter behaviour View Source
Behaviour for a Farmbot HTTP adapter implementation.
Link to this section Summary
Types
Adapter pid
HTTP request payload
HTTP request header
HTTP method
Options to the underlying http adapter
Callback for progress of a downloaded file. Arg 1 should be the the downloaded bytes. Arg 2 should be the total number of bytes, nil, or the atom :complete
A json serializable map of meta data about an upload
HTTP url. Must be fully formatted
Link to this section Types
Adapter pid.
HTTP request payload.
HTTP request header.
HTTP method.
Options to the underlying http adapter.
progress_callback() :: (number, number | nil | :complete -> any)
Callback for progress of a downloaded file. Arg 1 should be the the downloaded bytes. Arg 2 should be the total number of bytes, nil, or the atom :complete
A json serializable map of meta data about an upload.
HTTP url. Must be fully formatted.
Link to this section Callbacks
Download a file to the Filesystem.
HTTP Request.
Start the adapter.
upload_file(adapter, Path.t, upload_meta) :: :ok | {:error, term}
Upload a file.