AshOps.Task.Common (ash_ops v0.3.0)

Copy Markdown

Common behaviour for all tasks.

Summary

Functions

Format a value given the field type info and formatting configuration options

Format an error for display and exit with a non-zero status.

Return the filter field for the configured identity, or the primary key

Given a tuple containing a resource and a filter statement, use it to load the actor.

Serialise the record for display

Serialise a list of records for display

Functions

format_value(value, field_info, cfg)

Format a value given the field type info and formatting configuration options

handle_error(arg)

@spec handle_error({:error, any()}) :: no_return()

Format an error for display and exit with a non-zero status.

identity_or_pk_field(resource, cfg)

Return the filter field for the configured identity, or the primary key

load_actor(arg1, tenant)

@spec load_actor(nil | {Ash.Resource.t(), String.t()}, String.t()) ::
  {:ok, nil | Ash.Resource.record()} | {:error, any()}

Given a tuple containing a resource and a filter statement, use it to load the actor.

serialise_record(record, resource, cfg)

Serialise the record for display

serialise_records(records, resource, cfg)

Serialise a list of records for display