From 9fd14fc8d6d5e5e65ec44144c09908e582a3fefe Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Wed, 4 Aug 2021 15:18:19 +0200 Subject: New rebar app --- apps/styx/src/styx.app.src | 15 +++++++++++++++ apps/styx/src/styx_app.erl | 18 ++++++++++++++++++ apps/styx/src/styx_sup.erl | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 apps/styx/src/styx.app.src create mode 100644 apps/styx/src/styx_app.erl create mode 100644 apps/styx/src/styx_sup.erl (limited to 'apps') diff --git a/apps/styx/src/styx.app.src b/apps/styx/src/styx.app.src new file mode 100644 index 0000000..92a1e55 --- /dev/null +++ b/apps/styx/src/styx.app.src @@ -0,0 +1,15 @@ +{application, styx, + [{description, "Ory Kratos/Hydra Lightweight erlang frontend"}, + {vsn, "0.1.0"}, + {registered, []}, + {mod, {styx_app, []}}, + {applications, + [kernel, + stdlib + ]}, + {env,[]}, + {modules, []}, + + {licenses, ["Apache 2.0"]}, + {links, []} + ]}. diff --git a/apps/styx/src/styx_app.erl b/apps/styx/src/styx_app.erl new file mode 100644 index 0000000..7ea35cd --- /dev/null +++ b/apps/styx/src/styx_app.erl @@ -0,0 +1,18 @@ +%%%------------------------------------------------------------------- +%% @doc styx public API +%% @end +%%%------------------------------------------------------------------- + +-module(styx_app). + +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + styx_sup:start_link(). + +stop(_State) -> + ok. + +%% internal functions diff --git a/apps/styx/src/styx_sup.erl b/apps/styx/src/styx_sup.erl new file mode 100644 index 0000000..f9e812a --- /dev/null +++ b/apps/styx/src/styx_sup.erl @@ -0,0 +1,35 @@ +%%%------------------------------------------------------------------- +%% @doc styx top level supervisor. +%% @end +%%%------------------------------------------------------------------- + +-module(styx_sup). + +-behaviour(supervisor). + +-export([start_link/0]). + +-export([init/1]). + +-define(SERVER, ?MODULE). + +start_link() -> + supervisor:start_link({local, ?SERVER}, ?MODULE, []). + +%% sup_flags() = #{strategy => strategy(), % optional +%% intensity => non_neg_integer(), % optional +%% period => pos_integer()} % optional +%% child_spec() = #{id => child_id(), % mandatory +%% start => mfargs(), % mandatory +%% restart => restart(), % optional +%% shutdown => shutdown(), % optional +%% type => worker(), % optional +%% modules => modules()} % optional +init([]) -> + SupFlags = #{strategy => one_for_all, + intensity => 0, + period => 1}, + ChildSpecs = [], + {ok, {SupFlags, ChildSpecs}}. + +%% internal functions -- cgit v1.2.3