What a source is (spec/01 §2.1): its schema, its parameters, the capabilities it honors, and whether it answers every viewer the same.
schema: aMacaw.Data.Schema;params: the parameters it takes, by name (strings), each aMacaw.Data.Parameter;supports: the capabilities it honors, distinct, among:window | :box | :region | :latest | :budget | :push | :as_of. Every one is optional: Macaw finishes what a source does not honor (spec/01 §2.4);viewer_independent:truedeclares the source answers every viewer the same, which only allows pooling across viewers, fetched with the anonymous viewer (spec/01 §6).falseby default.
new/1 builds one and reports every fault at once.
Summary
Functions
The capabilities, in the order spec/01 §2.1 lists them.
A description of the given fields, schema required: {:ok, description} or every
fault, {path, reason}, ordered by path.
As new/1, raising ArgumentError naming every fault.
Types
@type capability() :: :window | :box | :region | :latest | :budget | :push | :as_of
A capability a source may honor.
@type t() :: %Macaw.Data.Source.Description{ params: %{required(String.t()) => Macaw.Data.Parameter.t()}, schema: Macaw.Data.Schema.t(), supports: [capability()], viewer_independent: boolean() }
Functions
@spec capabilities() :: [capability(), ...]
The capabilities, in the order spec/01 §2.1 lists them.
A description of the given fields, schema required: {:ok, description} or every
fault, {path, reason}, ordered by path.
iex> alias Macaw.Data.{Schema, Source.Description}
iex> {:ok, d} = Description.new(schema: Schema.new!(%{v: %{type: :number}}), supports: [:budget])
iex> {d.supports, d.viewer_independent}
{[:budget], false}
iex> Description.new(schema: :nope, supports: [:region, :teleport, :region])
{:error, [{[:schema], {:type, :schema}}, {[:supports, 1], {:enum, Description.capabilities()}}, {[:supports, 2], :duplicate}]}
As new/1, raising ArgumentError naming every fault.