zotonic_model behaviour (zotonic_core v1.0.0-rc.11)

Model behaviour

Link to this section Summary

Link to this section Types

-type opt_msg() :: mqtt_packet_map:mqtt_packet() | undefined.
-type return() :: {ok, {term(), list()}} | {error, unknown_path | term()}.

Link to this section Callbacks

Link to this callback

m_delete/3

(optional)
-callback m_delete([binary()], opt_msg(), z:context()) -> {ok, term()} | ok | {error, term()}.
-callback m_get(list(), opt_msg(), z:context()) -> return().
Link to this callback

m_post/3

(optional)
-callback m_post([binary()], opt_msg(), z:context()) -> {ok, term()} | ok | {error, term()}.