AuthShield v0.0.2 AuthShield.Resources.Behaviour behaviour View Source

AuthShield Resources behaviour.

Link to this section Summary

Types

Transactional responses of failed

Resource schemas types

Transactional responses of success

Link to this section Types

Link to this type

failed_response()

View Source
failed_response() :: {:error, Ecto.Changeset.t()}

Transactional responses of failed

Resource schemas types

Link to this type

success_response()

View Source
success_response() :: {:ok, resource()}

Transactional responses of success

Link to this section Callbacks

Link to this callback

delete!(model)

View Source
delete!(model :: resource()) :: resource() | no_return()
Link to this callback

get_by(filters)

View Source
get_by(filters :: keyword()) :: resource() | nil
Link to this callback

get_by!(filters)

View Source
get_by!(filters :: keyword()) :: resource() | no_return()
Link to this callback

insert!(params)

View Source
insert!(params :: map()) :: resource() | no_return()
Link to this callback

list(filters)

View Source
list(filters :: keyword()) :: [resource()]
Link to this callback

update(model, params)

View Source
update(model :: resource(), params :: map()) ::
  success_response() | failed_response()
Link to this callback

update!(model, params)

View Source
update!(model :: resource(), params :: map()) :: resource() | no_return()