@@ -21,61 +21,62 @@ import (
21
21
)
22
22
23
23
type Config struct {
24
- Mqtt Mqtt `yaml:"mqtt"`
25
- Log Log `yaml:"log"`
24
+ Mqtt Mqtt `yaml:"mqtt"`
25
+ Log Log `yaml:"log"`
26
+ Persistence Persistence `yaml:"persistence"`
26
27
}
27
28
28
29
type Mqtt struct {
29
30
// SessionExpiry is the maximum session expiry interval in seconds.
30
- SessionExpiry time.Duration `yaml:"session_expiry "`
31
+ SessionExpiry time.Duration `yaml:"sessionExpiry "`
31
32
// SessionExpiryCheckInterval is the interval time for session expiry checker to check whether there
32
33
// are expired sessions.
33
- SessionExpiryCheckInterval time.Duration `yaml:"session_expiry_check_interval "`
34
+ SessionExpiryCheckInterval time.Duration `yaml:"sessionExpiryCheckInterval "`
34
35
// MessageExpiry is the maximum lifetime of the message in seconds.
35
36
// If a message in the queue is not sent in MessageExpiry time, it will be removed, which means it will not be sent to the subscriber.
36
- MessageExpiry time.Duration `yaml:"message_expiry "`
37
+ MessageExpiry time.Duration `yaml:"messageExpiry "`
37
38
// InflightExpiry is the lifetime of the "inflight" message in seconds.
38
39
// If a "inflight" message is not acknowledged by a client in InflightExpiry time, it will be removed when the message queue is full.
39
- InflightExpiry time.Duration `yaml:"inflight_expiry "`
40
+ InflightExpiry time.Duration `yaml:"inflightExpiry "`
40
41
// MaxPacketSize is the maximum packet size that the server is willing to accept from the client
41
- MaxPacketSize uint32 `yaml:"max_packet_size "`
42
+ MaxPacketSize uint32 `yaml:"maxPacketSize "`
42
43
// ReceiveMax limits the number of QoS 1 and QoS 2 publications that the server is willing to process concurrently for the client.
43
- ReceiveMax uint16 `yaml:"server_receive_maximum "`
44
+ ReceiveMax uint16 `yaml:"serverReceiveMaximum "`
44
45
// MaxKeepAlive is the maximum keep alive time in seconds allows by the server.
45
46
// If the client requests a keepalive time bigger than MaxKeepalive,
46
47
// the server will use MaxKeepAlive as the keepalive time.
47
48
// In this case, if the client version is v5, the server will set MaxKeepalive into CONNACK to inform the client.
48
49
// But if the client version is 3.x, the server has no way to inform the client that the keepalive time has been changed.
49
- MaxKeepAlive uint16 `yaml:"max_keepalive "`
50
+ MaxKeepAlive uint16 `yaml:"maxKeepalive "`
50
51
// TopicAliasMax indicates the highest value that the server will accept as a Topic Alias sent by the client.
51
52
// No-op if the client version is MQTTv3.x
52
- TopicAliasMax uint16 `yaml:"topic_alias_maximum "`
53
+ TopicAliasMax uint16 `yaml:"topicAliasMaximum "`
53
54
// SubscriptionIDAvailable indicates whether the server supports Subscription Identifiers.
54
55
// No-op if the client version is MQTTv3.x .
55
- SubscriptionIDAvailable bool `yaml:"subscription_identifier_available "`
56
+ SubscriptionIDAvailable bool `yaml:"subscriptionIdentifierAvailable "`
56
57
// SharedSubAvailable indicates whether the server supports Shared Subscriptions.
57
- SharedSubAvailable bool `yaml:"shared_subscription_available "`
58
+ SharedSubAvailable bool `yaml:"sharedSubscriptionAvailable "`
58
59
// WildcardSubAvailable indicates whether the server supports Wildcard Subscriptions.
59
- WildcardAvailable bool `yaml:"wildcard_subscription_available "`
60
+ WildcardAvailable bool `yaml:"wildcardSubscriptionAvailable "`
60
61
// RetainAvailable indicates whether the server supports retained messages.
61
- RetainAvailable bool `yaml:"retain_available "`
62
+ RetainAvailable bool `yaml:"retainAvailable "`
62
63
// MaxQueuedMsg is the maximum queue length of the outgoing messages.
63
64
// If the queue is full, some message will be dropped.
64
65
// The message dropping strategy is described in the document of the persistence/queue.Store interface.
65
- MaxQueueMessages int `yaml:"max_queue_messages "`
66
+ MaxQueueMessages int `yaml:"maxQueueMessages "`
66
67
// MaxInflight limits inflight message length of the outgoing messages.
67
68
// Inflight message is also stored in the message queue, so it must be less than or equal to MaxQueuedMsg.
68
69
// Inflight message is the QoS 1 or QoS 2 message that has been sent out to a client but not been acknowledged yet.
69
- MaxInflight uint16 `yaml:"max_inflight "`
70
+ MaxInflight uint16 `yaml:"maxInflight "`
70
71
// MaximumQoS is the highest QOS level permitted for a Publish.
71
- MaximumQoS uint8 `yaml:"maximum_qos "`
72
+ MaximumQoS uint8 `yaml:"maximumQos "`
72
73
// QueueQos0Msg indicates whether to store QoS 0 message for a offline session.
73
- QueueQos0Msg bool `yaml:"queue_qos0_messages "`
74
+ QueueQos0Msg bool `yaml:"queueQos0Messages "`
74
75
// DeliveryMode is the delivery mode. The possible value can be "overlap" or "onlyonce".
75
76
// It is possible for a client’s subscriptions to overlap so that a published message might match multiple filters.
76
77
// When set to "overlap" , the server will deliver one message for each matching subscription and respecting the subscription’s QoS in each case.
77
78
// When set to "onlyOnce",the server will deliver the message to the client respecting the maximum QoS of all the matching subscriptions.
78
- DeliveryMode string `yaml:"delivery_mode "`
79
+ DeliveryMode string `yaml:"deliveryMode "`
79
80
// AllowZeroLenClientId indicates whether to allow a client to connect with empty client id.
80
- AllowZeroLenClientId bool `yaml:"allow_zero_len_client_id "`
81
+ AllowZeroLenClientId bool `yaml:"allowZeroLenClientId "`
81
82
}
0 commit comments