Searchex v0.0.1 Shake.Frame

Defines a struct that is passed up and down the Shake build chain.

defstruct cfg_snip: "",
          cfg_name: "",
          params:   %{},
          catalog:  %{},
          index:    %{},
          query:    "",
          scores:   [],
          results:  %{},
          tgt_id:   nil,
          tgt_doc:  %{},
          halted:   false,
          halt_msg: "",
          digests:  %{},
          assigns:  %{}

Summary

Functions

Assigns a value to a key in the frame

Retrieve the digest from the frame

Halts the Shake job by preventing downstream steps from being invoked. Optional halt_msg can be a String or list of Strings

Assign a digest to a key in the frame

Types

assigns()
assigns() :: %{optional(atom) => any}
catalog()
catalog() :: map
cfg_name()
cfg_name() :: String.t
cfg_snip()
cfg_snip() :: String.t
digests()
digests() :: %{optional(atom) => String.t}
halt_msg()
halt_msg() :: String.t | [String.t]
halted()
halted() :: boolean
index()
index() :: map
params()
params() :: map
query()
query() :: String.t
results()
results() :: map
scores()
scores() :: list
t()
t() :: %Shake.Frame{assigns: assigns, catalog: catalog, cfg_name: cfg_name, cfg_snip: cfg_snip, digests: digests, halt_msg: halt_msg, halted: halted, index: index, params: params, query: query, results: results, scores: scores, tgt_doc: tgt_doc, tgt_id: tgt_id}
tgt_doc()
tgt_doc() :: map
tgt_id()
tgt_id() :: integer

Functions

assign(frame, key, value)
assign(t, atom, term) :: t

Assigns a value to a key in the frame

Examples

iex> frame.assigns[:hello]
nil
iex> frame = assign(frame, :hello, :world)
iex> frame.assigns[:hello]
:world
get_digest(frame, key)

Retrieve the digest from the frame

halt(frame, halt_msg \\ "")

Halts the Shake job by preventing downstream steps from being invoked. Optional halt_msg can be a String or list of Strings.

set_digest(frame, key, value)

Assign a digest to a key in the frame