%%%-------------------------------------------------------------------
%% @doc automate_service_registry top level supervisor.
%% @end
%%%-------------------------------------------------------------------

-module(automate_service_registry_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

-define(SERVER, ?MODULE).
-include("../../automate_common_types/src/definitions.hrl").

%%====================================================================
%% API functions
%%====================================================================

start_link() ->
    supervisor:start_link({local, ?SERVER}, ?MODULE, []).

%%====================================================================
%% Supervisor callbacks
%%====================================================================

  Child : : { Id , StartFunc , Restart , Shutdown , Type , Modules }
init([]) ->

    {ok, { {one_for_all, ?AUTOMATE_SUPERVISOR_INTENSITY, ?AUTOMATE_SUPERVISOR_PERIOD},
           [ #{ id => automate_service_registry_mnesia_backend
              , start => {automate_service_registry_mnesia_backend, start_link, []}
              , restart => permanent
              , shutdown => 2000
              , type => worker
              , modules => [automate_service_registry_mnesia_backend]
              }
           ]} }.

%%====================================================================
  Internal functions
%%====================================================================

-------------------------------------------------------------------
 @doc automate_service_registry top level supervisor.
 @end
-------------------------------------------------------------------
 API
 Supervisor callbacks
====================================================================
 API functions
====================================================================
====================================================================
 Supervisor callbacks
====================================================================
====================================================================
====================================================================

-module(automate_service_registry_sup).

-behaviour(supervisor).

-export([start_link/0]).

-export([init/1]).

-define(SERVER, ?MODULE).
-include("../../automate_common_types/src/definitions.hrl").


start_link() ->
    supervisor:start_link({local, ?SERVER}, ?MODULE, []).


  Child : : { Id , StartFunc , Restart , Shutdown , Type , Modules }
init([]) ->

    {ok, { {one_for_all, ?AUTOMATE_SUPERVISOR_INTENSITY, ?AUTOMATE_SUPERVISOR_PERIOD},
           [ #{ id => automate_service_registry_mnesia_backend
              , start => {automate_service_registry_mnesia_backend, start_link, []}
              , restart => permanent
              , shutdown => 2000
              , type => worker
              , modules => [automate_service_registry_mnesia_backend]
              }
           ]} }.

  Internal functions
