55 lines
1.1 KiB
Erlang
55 lines
1.1 KiB
Erlang
%%% @doc
|
|
%%% The Hakuzaru Application Interface
|
|
%%%
|
|
%%% This module provides the Erlang system application behavior only.
|
|
%%% Please refer to the hz.erl module for the API.
|
|
%%% @end
|
|
|
|
-module(hakuzaru).
|
|
-vsn("0.4.1").
|
|
-author("Craig Everett <ceverett@tsuriai.jp>").
|
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
|
-license("GPL-3.0-or-later").
|
|
-behavior(application).
|
|
|
|
|
|
% OTP Application Interface
|
|
-export([start/0, stop/0]).
|
|
-export([start/2, stop/1]).
|
|
|
|
|
|
|
|
-spec start() -> ok | {error, Reason :: term()}.
|
|
%% @doc
|
|
%% Public function for manually starting the Hakuzaru application.
|
|
%%
|
|
%% NOTE:
|
|
%% To start it as a subordinate service within your own supervision tree rather than
|
|
%% as a peer Erlang application within your node, add the hz_sup to your own
|
|
%% supervision tree.
|
|
|
|
start() ->
|
|
application:start(hakuzaru).
|
|
|
|
|
|
-spec stop() -> ok | {error, Reason :: term()}.
|
|
%% @doc
|
|
%% Public function for manually stopping the Hakuzaru application.
|
|
|
|
stop() ->
|
|
application:stop(hakuzaru).
|
|
|
|
|
|
-spec start(normal, term()) -> {ok, pid()}.
|
|
%% @private
|
|
|
|
start(normal, _Args) ->
|
|
hz_sup:start_link().
|
|
|
|
|
|
-spec stop(term()) -> ok.
|
|
%% @private
|
|
|
|
stop(_State) ->
|
|
ok.
|