Exotus v0.1.0 Exotus.Metadata View Source
Handle encoding to and from the Upload-Metadata
header.
Link to this section Summary
Link to this section Types
Specs
header() :: String.t()
Specs
Link to this section Functions
Specs
Parse header content.
Example
iex> Exotus.Metadata.encode(%{"filename" => "world_domination_plan.pdf", "is_confidential" => :empty})
"filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential"
Specs
Parse header content.
Example
iex> Exotus.Metadata.parse("filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential")
{:ok, %{"filename" => "world_domination_plan.pdf", "is_confidential" => :empty}}
iex> Exotus.Metadata.parse("filename not_encoded,is_confidential")
:error