Exop v0.3.6 Exop.Operation behaviour
Provides macros for an operation’s contract definition and process/1 function.
Example
defmodule SomeOperation do
use Exop.Operation
parameter :param1, type: :integer, required: true
parameter :param2, type: :string, length: %{max: 3}, format: ~r/foo/
def process(params) do
"This is the operation's result with one of the params = " <> params[:param1]
end
end
Summary
Types
auth_result ::
:ok |
{:error, {:auth, :undefined_user}} |
{:error, {:auth, :undefined_policy}} |
{:error, {:auth, :undefined_action}} |
{:error, {:auth, atom}}
interrupt_error :: {:error, {:interrupt, any}}
Macros
Callbacks
Specs
process(Keyword.t | map) ::
{:ok, any} |
Exop.Validation.validation_error |
interrupt_error