Add gm_ctflow_state

This commit is contained in:
Ulf Wiger
2026-05-24 22:30:57 +02:00
parent 62161193c5
commit 2ea1966973
4 changed files with 95 additions and 4 deletions
+26 -1
View File
@@ -1,5 +1,30 @@
-module(gm_ctflow).
-type flow() :: any().
-export([ put/2
, get/1
, get/2
, erase/1
]).
-type flow() :: any().
-type key() :: any().
-type value() :: any().
-export_type([ flow/0 ]).
-spec put(key(), value()) -> 'ok'.
put(Key, Value) ->
gm_ctflow_state:put(Key, Value).
-spec get(key()) -> value() | no_return().
get(Key) ->
gm_ctflow_state:get(Key).
-spec get(key(), Default) -> value()
when Default :: value().
get(Key, Default) ->
gm_ctflow_state:get(Key, Default).
-spec erase(key()) -> 'ok'.
erase(Key) ->
gm_ctflow_state:erase(Key).