build: upgrade to go 1.17 and dependencies
This commit is contained in:
28
vendor/github.com/eclipse/paho.mqtt.golang/topic.go
generated
vendored
28
vendor/github.com/eclipse/paho.mqtt.golang/topic.go
generated
vendored
@ -19,18 +19,18 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
//ErrInvalidQos is the error returned when an packet is to be sent
|
||||
//with an invalid Qos value
|
||||
var ErrInvalidQos = errors.New("Invalid QoS")
|
||||
// ErrInvalidQos is the error returned when an packet is to be sent
|
||||
// with an invalid Qos value
|
||||
var ErrInvalidQos = errors.New("invalid QoS")
|
||||
|
||||
//ErrInvalidTopicEmptyString is the error returned when a topic string
|
||||
//is passed in that is 0 length
|
||||
var ErrInvalidTopicEmptyString = errors.New("Invalid Topic; empty string")
|
||||
// ErrInvalidTopicEmptyString is the error returned when a topic string
|
||||
// is passed in that is 0 length
|
||||
var ErrInvalidTopicEmptyString = errors.New("invalid Topic; empty string")
|
||||
|
||||
//ErrInvalidTopicMultilevel is the error returned when a topic string
|
||||
//is passed in that has the multi level wildcard in any position but
|
||||
//the last
|
||||
var ErrInvalidTopicMultilevel = errors.New("Invalid Topic; multi-level wildcard must be last level")
|
||||
// ErrInvalidTopicMultilevel is the error returned when a topic string
|
||||
// is passed in that has the multi level wildcard in any position but
|
||||
// the last
|
||||
var ErrInvalidTopicMultilevel = errors.New("invalid Topic; multi-level wildcard must be last level")
|
||||
|
||||
// Topic Names and Topic Filters
|
||||
// The MQTT v3.1.1 spec clarifies a number of ambiguities with regard
|
||||
@ -46,10 +46,14 @@ var ErrInvalidTopicMultilevel = errors.New("Invalid Topic; multi-level wildcard
|
||||
// - A TopicName may not contain a wildcard.
|
||||
// - A TopicFilter may only have a # (multi-level) wildcard as the last level.
|
||||
// - A TopicFilter may contain any number of + (single-level) wildcards.
|
||||
// - A TopicFilter with a # will match the absense of a level
|
||||
// - A TopicFilter with a # will match the absence of a level
|
||||
// Example: a subscription to "foo/#" will match messages published to "foo".
|
||||
|
||||
func validateSubscribeMap(subs map[string]byte) ([]string, []byte, error) {
|
||||
if len(subs) == 0 {
|
||||
return nil, nil, errors.New("invalid subscription; subscribe map must not be empty")
|
||||
}
|
||||
|
||||
var topics []string
|
||||
var qoss []byte
|
||||
for topic, qos := range subs {
|
||||
@ -75,7 +79,7 @@ func validateTopicAndQos(topic string, qos byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
if qos < 0 || qos > 2 {
|
||||
if qos > 2 {
|
||||
return ErrInvalidQos
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user