code-corps/code-corps-api

View on GitHub
lib/code_corps/github/event/handler.ex

Summary

Maintainability
Test Coverage
defmodule CodeCorps.GitHub.Event.Handler do
  @moduledoc ~S"""
  Default behavior for all GitHub webhook event handlers.
  """

  @doc ~S"""
  The only entry point a GitHub webhook event handler function should contain.

  Receives the GitHub payload, returns an `:ok` tuple if the process was
  successful, or an `:error` tuple, where the second element is an atom, if it
  failed.
  """
  @callback handle(map) :: {:ok, any} | {:error, atom} | {:error, atom, any}
end