Skip to content

Commit

Permalink
Add missing behaviour to Binary Installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoverlord committed Sep 17, 2024
1 parent 8d1692f commit 5cb389a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/peridiod/binary/installer/behaviour.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Peridiod.Binary.Installer.Behaviour do
end

def install_update(%Peridiod.Binary{}, {:error, reason}, state) do
{:error, reason}
{:error, reason, state}
end

def install_finish(%Peridiod.Binary{}, :invalid_signature, state) do
Expand All @@ -23,7 +23,15 @@ defmodule Peridiod.Binary.Installer.Behaviour do
{:ok, installer_state}
end

defoverridable install_init: 3, install_update: 3, install_finish: 3, install_info: 2
def install_error(%Peridiod.Binary{}, error, installer_state) do
{:error, error, installer_state}
end

defoverridable install_init: 3,
install_update: 3,
install_finish: 3,
install_info: 2,
install_error: 3
end
end

Expand All @@ -36,6 +44,10 @@ defmodule Peridiod.Binary.Installer.Behaviour do
{:ok, installer_state()} | {:error, reason :: any(), installer_state()}
@callback install_update(Binary.t(), data :: binary(), installer_state()) ::
{:ok, installer_state()} | {:error, reason :: any(), installer_state()}
@callback install_info(msg :: any, installer_state()) ::
{:ok, installer_state()} | {:error, reason :: any(), installer_state()}
@callback install_error(Binary.t(), reason :: any(), installer_state()) ::
{:ok, installer_state()} | {:error, reason :: any(), installer_state()}
@callback install_finish(Binary.t(), :valid_signature | :invalid_signature, installer_state()) ::
{:stop, reason :: any(), installer_state()}
| {:noreply, installer_state()}
Expand Down

0 comments on commit 5cb389a

Please sign in to comment.