antikythera v0.2.0 Antikythera.Context View Source

Definition of Antikythera.Context struct which represents a context for an execution of gear code.

Note that gear_entry_point is basically of type {module, atom}, it is nil during (1) executor_pool_web_request/1 and (2) no_route/1 error handler.

Link to this section Summary

Functions

Type-aware getter for context_id

Type-aware setter for context_id

Type-aware getter for executor_pool_id

Type-aware setter for executor_pool_id

Type-aware getter for gear_entry_point

Type-aware setter for gear_entry_point

Type-aware getter for gear_name

Type-aware setter for gear_name

Creates a new instance of Antikythera.Context by using the given dict

A variant of new/1 which returns t or raise if validation fails

Type-aware getter for start_time

Type-aware setter for start_time

Updates an existing instance of Antikythera.Context with the given dict. The values in the dict are validated by each field’s valid?/1 function. Returns {:ok, valid_struct} or {:error, reason}

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1

Checks if the given value belongs to t/0 or not

Link to this section Types

Link to this type t() View Source
t() :: %Antikythera.Context{context_id: Antikythera.ContextId.t(), executor_pool_id: Croma.TypeGen.Nilable.Antikythera.ExecutorPool.Id.t(), gear_entry_point: Croma.TypeGen.Nilable.Antikythera.Context.GearEntryPoint.t(), gear_name: Antikythera.GearName.t(), start_time: Antikythera.Time.t()}

Link to this section Functions

Link to this function context_id(context) View Source
context_id(t()) :: Antikythera.ContextId.t()

Type-aware getter for context_id.

Link to this function context_id(s, field) View Source
context_id(t(), Antikythera.ContextId.t()) :: t()

Type-aware setter for context_id.

Link to this function executor_pool_id(context) View Source
executor_pool_id(t()) :: Croma.TypeGen.Nilable.Antikythera.ExecutorPool.Id.t()

Type-aware getter for executor_pool_id.

Link to this function executor_pool_id(s, field) View Source
executor_pool_id(t(), Croma.TypeGen.Nilable.Antikythera.ExecutorPool.Id.t()) :: t()

Type-aware setter for executor_pool_id.

Link to this function gear_entry_point(context) View Source
gear_entry_point(t()) :: Croma.TypeGen.Nilable.Antikythera.Context.GearEntryPoint.t()

Type-aware getter for gear_entry_point.

Link to this function gear_entry_point(s, field) View Source
gear_entry_point(t(), Croma.TypeGen.Nilable.Antikythera.Context.GearEntryPoint.t()) :: t()

Type-aware setter for gear_entry_point.

Type-aware getter for gear_name.

Link to this function gear_name(s, field) View Source
gear_name(t(), Antikythera.GearName.t()) :: t()

Type-aware setter for gear_name.

Creates a new instance of Antikythera.Context by using the given dict.

Returns {:ok, valid_struct} or {:error, reason}.

The values in the dict are validated by each field’s valid?/1 function. If the value was invalid, it will be passed to new/1 of the field

For missing fields, followings will be tried:

  • default/0 of each field type
  • new/1 of each field type, with empty map as input

A variant of new/1 which returns t or raise if validation fails.

In other words, new/1 followed by Croma.Result.get!/1.

Link to this function start_time(context) View Source
start_time(t()) :: Antikythera.Time.t()

Type-aware getter for start_time.

Link to this function start_time(s, field) View Source
start_time(t(), Antikythera.Time.t()) :: t()

Type-aware setter for start_time.

Updates an existing instance of Antikythera.Context with the given dict. The values in the dict are validated by each field’s valid?/1 function. Returns {:ok, valid_struct} or {:error, reason}.

Link to this function update!(s, dict) View Source
update!(t(), Dict.t()) :: t()

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1.

Checks if the given value belongs to t/0 or not.