MongoosePush v2.1.0 MongoosePush.Service behaviour View Source

Generic interface for push notifications services.

Link to this section Summary

Types

Error tuple with unified internal representation and exact reason returned by service

Link to this section Types

Specs

error() :: {error_type(), error_reason()}

Error tuple with unified internal representation and exact reason returned by service

Specs

error_reason() :: atom()

Specs

error_type() ::
  :invalid_request
  | :internal_config
  | :auth
  | :unregistered
  | :too_many_requests
  | :unspecified
  | :service_internal
  | :payload_too_large
  | :unknown

Specs

notification() :: term()

Specs

options() :: [Keyword.t()]

Link to this section Callbacks

Specs

choose_pool(MongoosePush.mode(), [atom()]) ::
  MongoosePush.Application.pool_name() | nil
Link to this callback

prepare_notification(arg1, arg2, arg3)

View Source

Specs

prepare_notification(
  String.t(),
  MongoosePush.request(),
  MongoosePush.Application.pool_name()
) :: notification()
Link to this callback

push(notification, arg2, arg3, options)

View Source

Specs

push(
  notification(),
  String.t(),
  MongoosePush.Application.pool_name(),
  options()
) :: :ok | {:error, error()} | {:error, MongoosePush.error()}

Specs

supervisor_entry([MongoosePush.Application.pool_definition()] | nil) ::
  {module(), term()}