first commit

This commit is contained in:
niamtokik
2023-11-02 16:44:09 +00:00
commit 8d9f6f2a98
9 changed files with 158 additions and 0 deletions

20
.gitignore vendored Normal file
View File

@@ -0,0 +1,20 @@
.rebar3
_build
_checkouts
_vendor
.eunit
*.o
*.beam
*.plt
*.swp
*.swo
.erlang.cookie
ebin
log
erl_crash.dump
.rebar
logs
.idea
*.iml
rebar3.crashdump
*~

20
LICENSE.md Normal file
View File

@@ -0,0 +1,20 @@
Copyright 2023 Erlang Punch
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

9
README.md Normal file
View File

@@ -0,0 +1,9 @@
mnesia_backends
=====
An OTP application
Build
-----
$ rebar3 compile

View File

@@ -0,0 +1,15 @@
{application, mnesia_backends,
[{description, "An OTP application"},
{vsn, "0.1.0"},
{registered, []},
{mod, {mnesia_backends_app, []}},
{applications,
[kernel,
stdlib
]},
{env,[]},
{modules, []},
{licenses, ["Apache-2.0"]},
{links, []}
]}.

View File

@@ -0,0 +1,18 @@
%%%-------------------------------------------------------------------
%% @doc mnesia_backends public API
%% @end
%%%-------------------------------------------------------------------
-module(mnesia_backends_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
mnesia_backends_sup:start_link().
stop(_State) ->
ok.
%% internal functions

View File

@@ -0,0 +1,35 @@
%%%-------------------------------------------------------------------
%% @doc mnesia_backends top level supervisor.
%% @end
%%%-------------------------------------------------------------------
-module(mnesia_backends_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

3
config/sys.config Normal file
View File

@@ -0,0 +1,3 @@
[
{mnesia_backends, []}
].

6
config/vm.args Normal file
View File

@@ -0,0 +1,6 @@
-sname mnesia_backends
-setcookie mnesia_backends_cookie
+K true
+A30

32
rebar.config Normal file
View File

@@ -0,0 +1,32 @@
{erl_opts, [debug_info]}.
{deps, []}.
{relx, [{release, {mnesia_backends, "0.1.0"},
[mnesia_backends,
sasl]},
{mode, dev},
%% automatically picked up if the files
%% exist but can be set manually, which
%% is required if the names aren't exactly
%% sys.config and vm.args
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"}
%% the .src form of the configuration files do
%% not require setting RELX_REPLACE_OS_VARS
%% {sys_config_src, "./config/sys.config.src"},
%% {vm_args_src, "./config/vm.args.src"}
]}.
{profiles, [{prod, [{relx,
[%% prod is the default mode when prod
%% profile is used, so does not have
%% to be explicitly included like this
{mode, prod}
%% use minimal mode to exclude ERTS
%% {mode, minimal}
]
}]}]}.