Documentation
¶
Index ¶
Constants ¶
const LEVEL_SEPARATOR = "/"
const LOCALHOST = "127.0.0.1"
const MAX_TOPIC_SINGLE_SUBSCRIBE = 10
client can't subscribe more than N topics on a single "subscribe" command
const MAX_WAIT_FOR_ACK = 4
const MINIMUM_SUPPORTED_PROTOCOL = 4
const MQTT_V3_11 = 4
const MQTT_V5 = 5
const QOS0 = 0
const QOS1 = 1
const QOS2 = 2
const ROUTER_MODE_DEBUG = "debug"
"debug" act as "standard" but also dump all published messages to debug file, use SELECTED_CLIENTS to dump only some clients traffic
const ROUTER_MODE_SIMPLE = "simple"
"simple" stripped down router, match only fulltext topics, ignores pounds and pluses special chars
const ROUTER_MODE_STANDARD = "standard"
Router modes: "standard" router acts as standard mqtt router
const SUB_TOPIC_FILTER_INVALID = 143
SUBSCRIBE REASON CODE
const SUCCESS = 0
GENERIC REASON CODE
const TOPIC_SHARED = "$share"
const UNSUB_NO_SUB_EXISTED = 17
UNSUBSCRIBE REASON CODE
const UNSUB_UNSPECIFIED_ERROR = 128
const WILDCARD_MULTI_LEVEL = "#"
const WILDCARD_SINGLE_LEVEL = "+"
Variables ¶
var ACL_ON bool = true
var API_PORT string = ":8080"
TCP port for http API
var API_TOKEN_HOURS_DURATION int = 1
var API_TOKEN_ISSUER string = "TagYou"
var API_TOKEN_SIGNING_KEY []byte = []byte("generic_non_acceptable_key_2023")
var CLEAN_EXPIRED_RETRIES bool = true
(qos > 0) stop retries (wait for) for messages pub_ack pub_rec pub_rel pub_comp
var CLEAN_EXPIRED_RETRIES_INTERVAL int = 60
(minutes) interval at which check for expired retries cleanup (can be heavy on db, don't be too aggressive)
var CLEAN_EXPIRED_SESSIONS bool = true
clean expired sessions async (client_id never that never reconnects)
var CLEAN_EXPIRED_SESSIONS_INTERVAL int = 60
(minutes) interval at which check for expired sessions cleanup (can be heavy on db, don't be too aggressive)
var DB_NAME = "sqlite.db3"
db name for sqlite single file, ignored on badger
var DB_PATH = "."
full or relative dir where db files will reside
var DEBUG_CLIENTS = ""
list of selected clientId to debug traffic separated by slash "/" "client1/client2", empty string dump all traffic
var DEBUG_FILE string = "traffic.debug"
with router mode "debug": use this file to write traffic
var DEFAULT_KEEPALIVE int = 30
(secs) keepalive for tcp connections before mqtt connect
var FORBID_ANONYMOUS_LOGIN bool = true
var INIT_ADMIN_PASSWORD []byte = []byte("")
var INIT_DB = false
remove and
var LISTEN_PORT string = ":1883"
TCP port for mqtt binary connections
var PASSWORD_MIN_LENGTH int = 8
var RETRY_EXPIRATION int = 60
(secs) consider retry expired after RETRY_EXPIRATION secs
var ROUTER_MODE string = ROUTER_MODE_STANDARD
current router mode (can be overridden by env var)
var ROUTER_STARTING_CAPACITY = 10000
initial capacity of router (affects memory and performance at startup) affects only simple router and standard router
var SESSION_MAX_DURATION_SECONDS uint32 = 3600
(secs) session can't last more than
var WS_PORT string = ":1080"
TCP port for mqtt websocket connections
Functions ¶
Types ¶
This section is empty.