Bodyguard.Plug (Bodyguard v2.4.2) View Source

Work with Actions embedded in connections.

Link to this section Summary

Functions

Assign an Action to the connection.

Modify the existing Action on the connection, in-place.

Link to this section Functions

Link to this function

put_action(conn, action, key \\ :action)

View Source

Specs

put_action(conn :: Plug.Conn.t(), action :: Bodyguard.Action.t(), key :: atom()) ::
  Plug.Conn.t()

Assign an Action to the connection.

Inserts it into conn.assigns.action.

Link to this function

update_action(conn, fun, key \\ :action)

View Source

Specs

update_action(
  conn :: Plug.Conn.t(),
  fun :: (Bodyguard.Action.t() -> Bodyguard.Action.t()),
  key :: atom()
) :: Plug.Conn.t()

Modify the existing Action on the connection, in-place.