View Source Blunt.DispatchContext (blunt v0.1.0)

Link to this section Summary

Link to this section Types

Specs

command_context() :: %Blunt.DispatchContext{
  async: term(),
  created_at: term(),
  discarded_data: term(),
  errors: list(),
  last_pipeline_step: term(),
  message: struct(),
  message_module: term(),
  message_type: :command,
  metadata: term(),
  opts: term(),
  pipeline: term(),
  private: term(),
  return: term(),
  user: term(),
  user_supplied_fields: term()
}

Specs

context() :: t()

Specs

current_context() :: t() | {:ok, any(), t()}

Specs

query_context() :: %Blunt.DispatchContext{
  async: term(),
  created_at: term(),
  discarded_data: term(),
  errors: list(),
  last_pipeline_step: term(),
  message: struct(),
  message_module: term(),
  message_type: :query,
  metadata: term(),
  opts: term(),
  pipeline: term(),
  private: term(),
  return: term(),
  user: term(),
  user_supplied_fields: term()
}

Specs

t() :: %Blunt.DispatchContext{
  async: term(),
  created_at: term(),
  discarded_data: term(),
  errors: list(),
  last_pipeline_step: term(),
  message: struct(),
  message_module: term(),
  message_type: atom(),
  metadata: term(),
  opts: term(),
  pipeline: term(),
  private: term(),
  return: term(),
  user: term(),
  user_supplied_fields: term()
}

Link to this section Functions

Link to this function

async?(dispatch_context)

View Source

Specs

async?(context()) :: boolean()

Specs

errors(context()) :: map()
Link to this function

get_last_pipeline(context)

View Source

Specs

get_last_pipeline(context()) :: any() | nil
Link to this function

get_metadata(map, key, default \\ nil)

View Source

Specs

get_metadata(context(), atom(), any()) :: any() | nil
Link to this function

get_option(dispatch_context, key, default \\ nil)

View Source

Specs

get_option(context(), atom(), any() | nil) :: any() | nil
Link to this function

get_pipeline(dispatch_context)

View Source

Specs

get_pipeline(context()) :: map()
Link to this function

get_pipeline(context, key)

View Source

Specs

get_pipeline(context(), atom()) :: any() | nil
Link to this function

get_private(dispatch_context)

View Source

Specs

get_private(context()) :: map()
Link to this function

get_private(dispatch_context, key, default \\ nil)

View Source

Specs

get_private(context(), atom(), any() | nil) :: any() | nil
Link to this function

get_return(dispatch_context)

View Source

Specs

get_return(context()) :: :response | :context
Link to this function

new(message, discarded_data, opts)

View Source

Specs

new(message :: struct(), map(), keyword()) ::
  {:error, context()} | {:ok, context()}
Link to this function

options(dispatch_context)

View Source

Specs

options(context()) :: keyword()
Link to this function

push_private(context, key, value)

View Source

Specs

push_private(current_context(), atom(), any()) :: {:ok, any(), t()}
Link to this function

put_error(context, error)

View Source

Specs

put_error(context(), any()) :: context()
Link to this function

put_pipeline(context, key, value)

View Source

Specs

put_pipeline(context(), atom(), any()) :: context()
Link to this function

put_private(context, key, value)

View Source

Specs

put_private(context(), atom(), any()) :: context()
Link to this function

take_user_supplied_data(map)

View Source

Specs

take_user_supplied_data(context()) :: map()

Specs

user(context()) :: map() | nil
Link to this function

user_supplied_fields(map)

View Source

Specs

user_supplied_fields(context()) :: map()