View Source mqtt_sessions_runtime behaviour (mqtt_sessions v2.5.1)
Link to this section Summary
Functions
Check a message and its options before it is processed. Used for http connections with authentication cookies.
Re-authentication. This is called when the client requests a re-authentication (or replies in a AUTH re-authentication).
Link to this section Types
-type topic() :: [binary()].
-type user_context() :: term().
Link to this section Callbacks
-callback connect(mqtt_packet_map:mqtt_packet(), boolean(), map(), user_context()) -> {ok, mqtt_packet_map:mqtt_packet(), user_context()} | {error, term()}.
-callback control_message(topic(), mqtt_packet_map:mqtt_packet(), user_context()) -> {ok, user_context()}.
-callback is_allowed(publish | subscribe, topic(), mqtt_packet_map:mqtt_packet(), user_context()) -> boolean().
-callback is_valid_message(mqtt_packet_map:mqtt_packet(), mqtt_sessions:msg_options(), user_context()) -> boolean().
-callback new_user_context(atom(), binary(), mqtt_sessions:session_options()) -> term().
-callback pool_default() -> {ok, atom()} | {error, term()}.
-callback reauth(mqtt_packet_map:mqtt_packet(), user_context()) -> {ok, mqtt_packet_map:mqtt_packet(), user_context()} | {error, term()}.
-callback vhost_pool(binary()) -> {ok, atom()} | {error, term()}.
Link to this section Functions
-spec connect(mqtt_packet_map:mqtt_packet(), boolean(), mqtt_sessions:msg_options(), user_context()) -> {ok, mqtt_packet_map:mqtt_packet(), user_context()} | {error, term()}.
-spec control_message(topic(), mqtt_packet_map:mqtt_packet(), user_context()) -> {ok, user_context()}.
-spec is_allowed(publish | subscribe, topic(), mqtt_packet_map:mqtt_packet(), user_context()) -> boolean().
-spec is_valid_message(mqtt_packet_map:mqtt_packet(), mqtt_sessions:msg_options(), user_context()) -> boolean().
-spec new_user_context(atom(), binary(), mqtt_sessions:session_options()) -> term().
-spec pool_default() -> {ok, atom()} | {error, term()}.
-spec reauth(mqtt_packet_map:mqtt_packet(), user_context()) -> {ok, mqtt_packet_map:mqtt_packet(), user_context()} | {error, term()}.
-spec vhost_pool(binary()) -> {ok, atom()} | {error, term()}.