Manifest.Step (Manifest v0.3.2) View Source

Defines a Record that contains the necessary information to perform a step. The :work key defines the primary function to be run during the step. It should do the actual API call, GenServer call, or DB query. The :rollback key defines how the operation should be rolled back in the case of errors. It recieves a single arguement used to identify the resource to be reverted. The :parser key determines some form of identifier that the rollback function will recieve as it's argument. Can be anything as long as the rollback can use it.

Link to this section Summary

Link to this section Types

Specs

operation() :: atom()

Specs

parser() :: (any() -> {:ok, any()} | {:error, any()})

Specs

rollback() :: (any(), map() -> {:ok, any()} | {:error, any()})

Specs

t() ::
  {Manifest.Step, operation :: operation(), work :: work(), parser :: parser(),
   rollback :: rollback()}

Specs

valid_returns() :: {:ok, any()} | {:ok, :no_rollback, any()} | {:error, any()}

Specs

work() :: (map() -> valid_returns())

Link to this section Functions

Link to this macro

step(args \\ [])

View Source (macro)
Link to this macro

step(record, args)

View Source (macro)