aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/bootstrap.mk42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/bootstrap.mk b/plugins/bootstrap.mk
index 9397253..6fba54c 100644
--- a/plugins/bootstrap.mk
+++ b/plugins/bootstrap.mk
@@ -117,6 +117,48 @@ tpl_gen_server = "-module($(n))." \
"" \
"code_change(_OldVsn, State, _Extra) ->" \
" {ok, State}."
+tpl_gen_fsm = "-module($(n))." \
+ "-behaviour(gen_fsm)." \
+ "" \
+ "%% API." \
+ "-export([start_link/0])." \
+ "" \
+ "%% gen_fsm." \
+ "-export([init/1])." \
+ "-export([handle_event/3])." \
+ "-export([handle_sync_event/4])." \
+ "-export([handle_info/3])." \
+ "-export([terminate/3])." \
+ "-export([code_change/4])." \
+ "" \
+ "-record(state, {" \
+ "})." \
+ "" \
+ "%% API." \
+ "" \
+ "-spec start_link() -> {ok, pid()}." \
+ "start_link() ->" \
+ " gen_fsm:start_link(?MODULE, [], [])." \
+ "" \
+ "%% gen_fsm." \
+ "" \
+ "init([]) ->" \
+ " {ok, initial_state, \#state{}}." \
+ "" \
+ "handle_event(_Event, StateName, State) ->" \
+ " {next_state, StateName, State}." \
+ "" \
+ "handle_sync_event(_Event, _From, StateName, State) ->" \
+ " {reply, ignored, StateName, State}." \
+ "" \
+ "handle_info(_Info, StateName, State) ->" \
+ " {next_state, StateName, State}." \
+ "" \
+ "terminate(_Reason, _StateName, _State) ->" \
+ " ok." \
+ "" \
+ "code_change(_OldVsn, StateName, State, _Extra) ->" \
+ " {ok, StateName, State}."
tpl_cowboy_http = "-module($(n))." \
"-behaviour(cowboy_http_handler)." \
"" \