View Source BoomSlackNotifier.SlackAdapter behaviour (boom_slack_notifier v0.1.0)

By default BoomSlackNotifier uses HTTPoison as the http client.

You can setup your favorite client by warpping it with the SlackAdapter behaviour, for example:

#mojito_http_adapter.ex

@impl BoomSlackNotifier.SlackAdapter
@spec post(any, binary, any) :: {:ok, any} | {:error, any}
def post(body, url, headers) do
  {:ok, response} = Mojito.request(body: body, method: :post, url: url, headers: headers)
  # ...
end

And then specifying it in your application configuration:

#config.exs

config :boom_slack_notifier, :slack_adapter, MyApp.MojitoHttpAdapter

Default configuration (not required):

config :boom_slack_notifier, :slack_adapter, BoomSlackNotifier.SlackClient.HTTPoisonAdapter

Link to this section Summary

Callbacks

Defines a callback to be used by the http adapters

Link to this section Callbacks

@callback post(any(), binary(), any()) :: {:ok, any()} | {:error, any()}

Defines a callback to be used by the http adapters