Module z_mqtt_sessions_runtime

Zotonic specific callbacks for MQTT connections.

Copyright © 2018-2019 Marc Worrell

Behaviours: mqtt_sessions_runtime.

Authors: Marc Worrell (marc@worrell.nl).

Description

Zotonic specific callbacks for MQTT connections

Function Index

connect/4
control_message/3
is_allowed/4
is_valid_message/3If the connection is authenticated, then the connection user MUST be the session user.
new_user_context/3
pool_default/0
reauth/2Re-authentication.
vhost_pool/1Return the MQTT pool name for the given hostname.

Function Details

connect/4

connect(Packet::mqtt_packet_map:mqtt_packet(), IsSessionPresent::boolean(), Options::mqtt_session:msg_options(), Context::z:context()) -> {ok, mqtt_packet_map:mqtt_packet(), z:context()} | {error, term()}

control_message/3

control_message(Topic::list(), Packet::mqtt_packet_map:mqtt_packet(), Context::z:context()) -> {ok, z:context()}

is_allowed/4

is_allowed(Action::publish | subscribe, Topic::mqtt_sessions_runtime:topic(), Packet::mqtt_packet_map:mqtt_packet(), Context::z:context()) -> boolean()

is_valid_message/3

is_valid_message(Msg::mqtt_packet_map:mqtt_packet(), Options::mqtt_sessions:msg_options(), Context::z:context()) -> boolean()

If the connection is authenticated, then the connection user MUST be the session user.

new_user_context/3

new_user_context(Site::atom(), ClientId::binary(), SessionOptions::mqtt_sessions:session_options()) -> z:context()

pool_default/0

pool_default() -> {error, unknown_host}

reauth/2

reauth(X1::mqtt_packet_map:mqtt_packet(), Context::z:context()) -> {ok, mqtt_packet_map:mqtt_packet(), z:context()} | {error, term()}

Re-authentication. This is called when the client requests a re-authentication (or replies in a AUTH re-authentication).

vhost_pool/1

vhost_pool(Hostname::binary()) -> {ok, atom()} | {error, unknown_host}

Return the MQTT pool name for the given hostname.


Generated by EDoc