Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultDeliveryRetryInterval = 20 DefaultQueueQos0Messages = true DefaultMaxInflightMessages = 20 DefaultLogging = false DefaultMaxMsgQueueMessages = 2048 )
Default configration
View Source
const ProtocolMQTT = "mqtt"
ProtocolMQTT represents the MQTT protocol under TCP server
View Source
const ProtocolWebsocket = "websocket"
ProtocolWebsocket represents the MQTT protocol under websocket server.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
Command represents the command executed by `go run main.go`
func (*Command) ParseConfig ¶
ParseConfig parses the config at path. It returns a demo configuration if path is blank.
func (*Command) ParseFlags ¶
ParseFlags parses the args into Options.
type Config ¶
type Config struct { DeliveryRetryInterval int64 `yaml:"delivery_retry_interval"` QueueQos0Messages bool `yaml:"queue_qos0_messages"` MaxInflightMessages int `yaml:"max_inflight_messages"` MaxMsgQueueMessages int `yaml:"max_msgqueue_messages"` ProfileConfig ProfileConfig `yaml:"profile"` Listener []ListenerConfig `yaml:"listener,flow"` Logging bool `yaml:"logging"` HttpServerConfig HttpServerConfig `yaml:"http_server"` }
Config represents the configuration options.
func (*Config) FromConfigFile ¶
FromConfigFile loads the configuration from a yaml file
type HttpServerConfig ¶
HttpServerConfig represents the REST server configuration.
type ListenerConfig ¶
type ListenerConfig struct { Protocol string `yaml:"protocol"` Addr string `yaml:"addr"` CertFile string `yaml:"certfile"` KeyFile string `yaml:"keyfile"` }
ListenerConfig represents the tcp server configuration.
type Options ¶
type Options struct {
ConfigPath string
}
Options contains the path of configuration file
type ProfileConfig ¶
ProfileConfig represents the server profile configuration.
Click to show internal directories.
Click to hide internal directories.