EctoMiddleware.Resolution (ecto_middleware v1.0.0) View Source

Struct for holding middleware resolution data

Link to this section Summary

Functions

Executes all of the configured "after" middleware for the given resolution.

Executes all of the configured "before" middleware for the given resolution.

Link to this section Types

Specs

t() :: %EctoMiddleware.Resolution{
  action: term(),
  after_input: term(),
  after_middleware: term(),
  after_output: term(),
  args: term(),
  before_input: term(),
  before_middleware: term(),
  before_output: term(),
  entity: term(),
  middleware: term(),
  repo: term()
}

Link to this section Functions

Link to this function

execute_after!(resolution, input)

View Source

Specs

execute_after!(t(), input :: term()) :: t()

Executes all of the configured "after" middleware for the given resolution.

This function is intended to be used by the EctoMiddleware module, but can also be used directly if you need to execute the "after" middleware for testing purposes.

Provide a resolution struct as the argument with action, args, and entity fields, alongside the repo module that the middleware is being executed for, alongside the expected return value of the given Ecto.Repo callback.

Link to this function

execute_before!(resolution)

View Source

Specs

execute_before!(t()) :: t()

Executes all of the configured "before" middleware for the given resolution.

This function is intended to be used by the EctoMiddleware module, but can also be used directly if you need to execute the "before" middleware for testing purposes.

Provide a resolution struct as the argument with action, args, and entity fields, alongside the repo module that the middleware is being executed for.