diff options
author | Tristan Sloughter <t@crashfast.com> | 2019-05-08 12:21:31 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2019-05-08 12:22:57 -0600 |
commit | 052a4e842845235ce3aa5e16bd9de156f7b8968c (patch) | |
tree | 65156cde06bf6744334adbc59b9e98cc9fe11f68 /priv | |
parent | af9d2086b33997c16bafe02dcd5bcd9453407849 (diff) |
remove large comment blocks from templates and use maps in sup
Diffstat (limited to 'priv')
-rw-r--r-- | priv/templates/app.erl | 10 | ||||
-rw-r--r-- | priv/templates/mod.erl | 10 | ||||
-rw-r--r-- | priv/templates/sup.erl | 33 |
3 files changed, 16 insertions, 37 deletions
diff --git a/priv/templates/app.erl b/priv/templates/app.erl index 62d2ddf..80aeca3 100644 --- a/priv/templates/app.erl +++ b/priv/templates/app.erl @@ -7,20 +7,12 @@ -behaviour(application). -%% Application callbacks -export([start/2, stop/1]). -%%==================================================================== -%% API -%%==================================================================== - start(_StartType, _StartArgs) -> {{name}}_sup:start_link(). -%%-------------------------------------------------------------------- stop(_State) -> ok. -%%==================================================================== -%% Internal functions -%%==================================================================== +%% internal functions diff --git a/priv/templates/mod.erl b/priv/templates/mod.erl index 2f5e09e..05329f0 100644 --- a/priv/templates/mod.erl +++ b/priv/templates/mod.erl @@ -1,13 +1,3 @@ -module({{name}}). -%% API exports -export([]). - -%%==================================================================== -%% API functions -%%==================================================================== - - -%%==================================================================== -%% Internal functions -%%==================================================================== diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index 020021c..c7d546b 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -8,32 +8,29 @@ -behaviour(supervisor). -%% API -export([start_link/0]). -%% Supervisor callbacks -export([init/1]). -define(SERVER, ?MODULE). -%%==================================================================== -%% API functions -%%==================================================================== - start_link() -> supervisor:start_link({local, ?SERVER}, ?MODULE, []). -%%==================================================================== -%% Supervisor callbacks -%%==================================================================== - -%% Child :: #{id => Id, start => {M, F, A}} -%% Optional keys are restart, shutdown, type, modules. -%% Before OTP 18 tuples must be used to specify a child. e.g. -%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} +%% 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([]) -> - {ok, {{one_for_all, 0, 1}, []}}. + SupFlags = #{strategy => one_for_all + intensity => 0, + period => 1}, + ChildSpecs = [], + {ok, {SupFlags, ChildSpecs}}. -%%==================================================================== -%% Internal functions -%%==================================================================== +%% internal functions |