Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // TCP address (<IP>:<port>) that the MQTT will bind to. TCPAddress string // The size, in bytes, of the MQTT receiver and transmitter buffers. BufferSize int // The maximum packet size, in bytes, allowed. MaxPacketSize int // The maximum session expire interval, in seconds, allowed by the server. MaxSessionExpiryInterval int // The maximum message expiry interval, in seconds. MaxMessageExpiryInterval int // SysTopicUpdateInterval specifies, in seconds, the interval between $SYS topic updates. SysTopicUpdateInterval int // The maximum number of outbound message for a client. MaxOutboundMessages int // The maximum number of topic aliases that an MQTT V5 client is allowed to create. MaxTopicAlias int // The maximum number of QoS 1 and QoS 2 publications that it is willing to process concurrently. ReceiveMaximum int // The maximum QoS for PUBLISH Packets accepted by the server. MaximumQoS byte // The minimum supported MQTT version. MinProtocolVersion byte // Indicate whether the server allows retained messages or not. RetainAvailable bool // Indicate whether the server allows wildcard subscription or not. WildcardSubscriptionAvailable bool // Indicate whether the server allows subscription identifier or not. SubscriptionIDAvailable bool SharedSubscriptionAvailable bool // Indicate whether the server exports metrics or not. MetricsEnabled bool }
Config contains the MQTT Server configuration.
type OptionFn ¶
type OptionFn func(*Server)
OptionFn is a function responsible to inject an option inside the MQTT Server.
func WithConfig ¶
WithConfig is an option function to inject the Config inside the MQTT Server.
func WithLogger ¶
WithLogger is an option function to inject the logger.Logger inside the MQTT Server.
func WithMachineID ¶
WithMachineID is an option function to inject the machine ID inside the MQTT Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an MQTT server. It must be created using the NewServer function.
func NewServer ¶
NewServer creates an instance of the MQTT Server. It takes a variable number of OptionFn and returns the Server instance or an error.
Click to show internal directories.
Click to hide internal directories.