Fix more golangci-lint issues
This commit is contained in:
parent
9cd116c5e4
commit
807ea96d67
4 changed files with 62 additions and 62 deletions
|
@ -12,27 +12,27 @@ type ConnectReasonCode byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ConnectReasonCodeSuccess ConnectReasonCode = 0
|
ConnectReasonCodeSuccess ConnectReasonCode = 0
|
||||||
ConnectReasonCodeUnspecified = 128
|
ConnectReasonCodeUnspecified ConnectReasonCode = 128
|
||||||
ConnectReasonCodeMalformedPacket = 129
|
ConnectReasonCodeMalformedPacket ConnectReasonCode = 129
|
||||||
ConnectReasonCodeProtocolError = 130
|
ConnectReasonCodeProtocolError ConnectReasonCode = 130
|
||||||
ConnectReasonCodeImplErorr = 131
|
ConnectReasonCodeImplErorr ConnectReasonCode = 131
|
||||||
ConnectReasonCodeUnsupportedProtoVer = 132
|
ConnectReasonCodeUnsupportedProtoVer ConnectReasonCode = 132
|
||||||
ConnectReasonCodeClientIDNotValid = 133
|
ConnectReasonCodeClientIDNotValid ConnectReasonCode = 133
|
||||||
ConnectReasonCodeBadUsernameOrPassword = 134
|
ConnectReasonCodeBadUsernameOrPassword ConnectReasonCode = 134
|
||||||
ConnectReasonCodeNotAuthorized = 135
|
ConnectReasonCodeNotAuthorized ConnectReasonCode = 135
|
||||||
ConnectReasonCodeServerUnavaliable = 136
|
ConnectReasonCodeServerUnavaliable ConnectReasonCode = 136
|
||||||
ConnectReasonCodeServerBusy = 137
|
ConnectReasonCodeServerBusy ConnectReasonCode = 137
|
||||||
ConnectReasonCodeBanned = 138
|
ConnectReasonCodeBanned ConnectReasonCode = 138
|
||||||
ConnectReasonCodeBadAuthenticationMethod = 140
|
ConnectReasonCodeBadAuthenticationMethod ConnectReasonCode = 140
|
||||||
ConnectReasonCodeTopicNameInvalid = 144
|
ConnectReasonCodeTopicNameInvalid ConnectReasonCode = 144
|
||||||
ConnectReasonCodePacketTooLarge = 149
|
ConnectReasonCodePacketTooLarge ConnectReasonCode = 149
|
||||||
ConnectReasonCodeQuotaExceeded = 151
|
ConnectReasonCodeQuotaExceeded ConnectReasonCode = 151
|
||||||
ConnectReasonCodePayloadFormatInvalid = 153
|
ConnectReasonCodePayloadFormatInvalid ConnectReasonCode = 153
|
||||||
ConnectReasonCodeRetainNotSupported = 154
|
ConnectReasonCodeRetainNotSupported ConnectReasonCode = 154
|
||||||
ConnectReasonCodeQoSNotSupported = 155
|
ConnectReasonCodeQoSNotSupported ConnectReasonCode = 155
|
||||||
ConnectReasonCodeUseAnotherServer = 156
|
ConnectReasonCodeUseAnotherServer ConnectReasonCode = 156
|
||||||
ConnectReasonCodeServerMoved = 157
|
ConnectReasonCodeServerMoved ConnectReasonCode = 157
|
||||||
ConnectReasonCodeConnectionRateExceeded = 159
|
ConnectReasonCodeConnectionRateExceeded ConnectReasonCode = 159
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConnackPacket struct {
|
type ConnackPacket struct {
|
||||||
|
|
|
@ -9,14 +9,14 @@ type PubackReasonCode byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PubackReasonCodeSuccess PubackReasonCode = 0
|
PubackReasonCodeSuccess PubackReasonCode = 0
|
||||||
PubackReasonCodeNoMatchingSubscribers = 16
|
PubackReasonCodeNoMatchingSubscribers PubackReasonCode = 16
|
||||||
PubackReasonCodeUnspecifiedError = 128
|
PubackReasonCodeUnspecifiedError PubackReasonCode = 128
|
||||||
PubackReasonCodeImplementationSpecyficEror = 131
|
PubackReasonCodeImplementationSpecyficEror PubackReasonCode = 131
|
||||||
PubackReasonCodeNotAuthorized = 135
|
PubackReasonCodeNotAuthorized PubackReasonCode = 135
|
||||||
PubackReasonCodeTopicNameInvalid = 144
|
PubackReasonCodeTopicNameInvalid PubackReasonCode = 144
|
||||||
PubackReasonCodePacketIDInUse = 145
|
PubackReasonCodePacketIDInUse PubackReasonCode = 145
|
||||||
PubackReasonCodeQuotaExceeded = 151
|
PubackReasonCodeQuotaExceeded PubackReasonCode = 151
|
||||||
PubackReasonCodePayloadFormatInvalid = 153
|
PubackReasonCodePayloadFormatInvalid PubackReasonCode = 153
|
||||||
)
|
)
|
||||||
|
|
||||||
type PubackPacket struct {
|
type PubackPacket struct {
|
||||||
|
@ -55,7 +55,7 @@ type PubrelReasonCode byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PubrelReasonCodeSuccess PubackReasonCode = 0
|
PubrelReasonCodeSuccess PubackReasonCode = 0
|
||||||
PubrelReasonPacketIDNotFound = 146
|
PubrelReasonPacketIDNotFound PubackReasonCode = 146
|
||||||
)
|
)
|
||||||
|
|
||||||
type PubrelPacket struct {
|
type PubrelPacket struct {
|
||||||
|
|
|
@ -118,18 +118,18 @@ func (p SubscribePacket) Visit(v PacketVisitor) {
|
||||||
type SubackReasonCode byte
|
type SubackReasonCode byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SubackReasonGrantedQoSZero PubackReasonCode = 0
|
SubackReasonGrantedQoSZero SubackReasonCode = 0
|
||||||
SubackReasonGrantedQoSOne = 1
|
SubackReasonGrantedQoSOne SubackReasonCode = 1
|
||||||
SubackReasonGrantedQoSTwo = 2
|
SubackReasonGrantedQoSTwo SubackReasonCode = 2
|
||||||
SubackReasonUnspecified = 128
|
SubackReasonUnspecified SubackReasonCode = 128
|
||||||
SubackReasonImplSpecificError = 131
|
SubackReasonImplSpecificError SubackReasonCode = 131
|
||||||
SubackReasonNotAuthorized = 135
|
SubackReasonNotAuthorized SubackReasonCode = 135
|
||||||
SubackReasonTopicFilterInvalid = 143
|
SubackReasonTopicFilterInvalid SubackReasonCode = 143
|
||||||
SubackReasonPacketIDInUse = 145
|
SubackReasonPacketIDInUse SubackReasonCode = 145
|
||||||
SubackReasonQuotaExceeded = 151
|
SubackReasonQuotaExceeded SubackReasonCode = 151
|
||||||
SubackReasonSharedSubNotSupported = 158
|
SubackReasonSharedSubNotSupported SubackReasonCode = 158
|
||||||
SubackReasonSubIDUnsupported = 161
|
SubackReasonSubIDUnsupported SubackReasonCode = 161
|
||||||
SubackReasonWildcardSubUnsupported = 162
|
SubackReasonWildcardSubUnsupported SubackReasonCode = 162
|
||||||
)
|
)
|
||||||
|
|
||||||
type SubAckPacket struct {
|
type SubAckPacket struct {
|
||||||
|
@ -219,11 +219,11 @@ type UnsubackReasonCode byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
UnsubackReasonSuccess UnsubackReasonCode = 0
|
UnsubackReasonSuccess UnsubackReasonCode = 0
|
||||||
UnSubackReasonUnspecified = 128
|
UnSubackReasonUnspecified UnsubackReasonCode = 128
|
||||||
UnSubackReasonImplSpecificError = 131
|
UnSubackReasonImplSpecificError UnsubackReasonCode = 131
|
||||||
UnSubackReasonNotAuthorized = 135
|
UnSubackReasonNotAuthorized UnsubackReasonCode = 135
|
||||||
UnSubackReasonTopicFilterInvalid = 143
|
UnSubackReasonTopicFilterInvalid UnsubackReasonCode = 143
|
||||||
UnSubackReasonPacketIDInUse = 145
|
UnSubackReasonPacketIDInUse UnsubackReasonCode = 145
|
||||||
)
|
)
|
||||||
|
|
||||||
type UnsubAckPacket struct {
|
type UnsubAckPacket struct {
|
||||||
|
|
|
@ -33,21 +33,21 @@ type PacketType byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PacketTypeReserved PacketType = 0 // Forbidden
|
PacketTypeReserved PacketType = 0 // Forbidden
|
||||||
PacketTypeConnect = 1
|
PacketTypeConnect PacketType = 1
|
||||||
PacketTypeConnack = 2
|
PacketTypeConnack PacketType = 2
|
||||||
PacketTypePublish = 3
|
PacketTypePublish PacketType = 3
|
||||||
PacketTypePuback = 4
|
PacketTypePuback PacketType = 4
|
||||||
PacketTypePubrec = 5
|
PacketTypePubrec PacketType = 5
|
||||||
PacketTypePubrel = 6
|
PacketTypePubrel PacketType = 6
|
||||||
PacketTypePubcomp = 7
|
PacketTypePubcomp PacketType = 7
|
||||||
PacketTypeSubscribe = 8
|
PacketTypeSubscribe PacketType = 8
|
||||||
PacketTypeSuback = 9
|
PacketTypeSuback PacketType = 9
|
||||||
PacketTypeUnsubscribe = 10
|
PacketTypeUnsubscribe PacketType = 10
|
||||||
PacketTypeUnsuback = 11
|
PacketTypeUnsuback PacketType = 11
|
||||||
PacketTypePingreq = 12
|
PacketTypePingreq PacketType = 12
|
||||||
PacketTypePingresp = 13
|
PacketTypePingresp PacketType = 13
|
||||||
PacketTypeDisconnect = 14
|
PacketTypeDisconnect PacketType = 14
|
||||||
PacketTypeAuth = 15
|
PacketTypeAuth PacketType = 15
|
||||||
)
|
)
|
||||||
|
|
||||||
func ReadPacket(r *bufio.Reader) (*ClientPacket, error) {
|
func ReadPacket(r *bufio.Reader) (*ClientPacket, error) {
|
||||||
|
|
Loading…
Reference in a new issue