优化结构
This commit is contained in:
@@ -27,6 +27,9 @@ func NormalizeSubscriptionSet(set SubscriptionSet) (SubscriptionSet, error) {
|
||||
if set.Topics[index].QoS > ExactlyOnce {
|
||||
return SubscriptionSet{}, fmt.Errorf("invalid mq qos %d for topic %q", set.Topics[index].QoS, set.Topics[index].Topic)
|
||||
}
|
||||
if set.Provider != ProviderEMQX && set.Topics[index].QoS > AtLeastOnce {
|
||||
return SubscriptionSet{}, fmt.Errorf("mq provider %q supports qos 0 or 1 for topic %q", set.Provider, set.Topics[index].Topic)
|
||||
}
|
||||
if set.Topics[index].Handler == nil {
|
||||
return SubscriptionSet{}, fmt.Errorf("mq subscription handler is nil for topic %q", set.Topics[index].Topic)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user