maeqtt/mqtt/GeneratedProperties.go

688 lines
12 KiB
Go
Raw Normal View History

2021-08-26 15:08:24 +02:00
package mqtt
2021-10-01 22:18:48 +02:00
// This code has been generated with the genProps.py script. Do not modify
2021-08-26 15:08:24 +02:00
import "bufio"
type PayloadFormatIndicator struct {
value *byte
}
func (p PayloadFormatIndicator) id() int {
return 1
}
func (p *PayloadFormatIndicator) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type MessageExpiryInterval struct {
value *uint32
}
func (p MessageExpiryInterval) id() int {
return 2
}
func (p *MessageExpiryInterval) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint32(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ContentType struct {
value *string
}
func (p ContentType) id() int {
return 3
}
func (p *ContentType) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ResponseTopic struct {
value *string
}
func (p ResponseTopic) id() int {
return 8
}
func (p *ResponseTopic) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type CorrelationData struct {
value *[]byte
}
func (p CorrelationData) id() int {
return 9
}
func (p *CorrelationData) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeBinaryData(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type SubscriptionIdentifier struct {
value *int
}
func (p SubscriptionIdentifier) id() int {
return 11
}
func (p *SubscriptionIdentifier) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeVariableByteInt(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type SessionExpiryInterval struct {
value *uint32
}
func (p SessionExpiryInterval) id() int {
return 17
}
func (p *SessionExpiryInterval) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint32(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type AssignedClientIdentifier struct {
value *string
}
func (p AssignedClientIdentifier) id() int {
return 18
}
func (p *AssignedClientIdentifier) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ServerKeepAlive struct {
value *uint16
}
func (p ServerKeepAlive) id() int {
return 19
}
func (p *ServerKeepAlive) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint16(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type AuthenticationMethod struct {
value *string
}
func (p AuthenticationMethod) id() int {
return 21
}
func (p *AuthenticationMethod) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type AuthenticationData struct {
value *[]byte
}
func (p AuthenticationData) id() int {
return 22
}
func (p *AuthenticationData) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeBinaryData(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type RequestProblemInformation struct {
value *byte
}
func (p RequestProblemInformation) id() int {
return 23
}
func (p *RequestProblemInformation) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type WillDelayInterval struct {
value *uint32
}
func (p WillDelayInterval) id() int {
return 24
}
func (p *WillDelayInterval) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint32(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type RequestResponseInformation struct {
value *byte
}
func (p RequestResponseInformation) id() int {
return 25
}
func (p *RequestResponseInformation) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ResponseInformation struct {
value *string
}
func (p ResponseInformation) id() int {
return 26
}
func (p *ResponseInformation) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ServerReference struct {
value *string
}
func (p ServerReference) id() int {
return 28
}
func (p *ServerReference) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ReasonString struct {
value *string
}
func (p ReasonString) id() int {
return 31
}
func (p *ReasonString) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUTF8String(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type ReceiveMaximum struct {
value *uint16
}
func (p ReceiveMaximum) id() int {
return 33
}
func (p *ReceiveMaximum) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint16(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type TopicAliasMaximum struct {
value *uint16
}
func (p TopicAliasMaximum) id() int {
return 34
}
func (p *TopicAliasMaximum) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint16(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type TopicAlias struct {
value *uint16
}
func (p TopicAlias) id() int {
return 35
}
func (p *TopicAlias) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint16(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type MaximumQoS struct {
value *byte
}
func (p MaximumQoS) id() int {
return 36
}
func (p *MaximumQoS) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type RetainAvailable struct {
value *byte
}
func (p RetainAvailable) id() int {
return 37
}
func (p *RetainAvailable) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type MaximumPacketSize struct {
value *uint32
}
func (p MaximumPacketSize) id() int {
return 39
}
func (p *MaximumPacketSize) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := decodeUint32(r)
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type WildcardSubscriptionAvailable struct {
value *byte
}
func (p WildcardSubscriptionAvailable) id() int {
return 40
}
func (p *WildcardSubscriptionAvailable) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type SubscriptionIdentifierAvailable struct {
value *byte
}
func (p SubscriptionIdentifierAvailable) id() int {
return 41
}
func (p *SubscriptionIdentifierAvailable) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
type SharedSubscriptionAvailable struct {
value *byte
}
func (p SharedSubscriptionAvailable) id() int {
return 42
}
func (p *SharedSubscriptionAvailable) parse(r *bufio.Reader) error {
2021-10-01 22:18:48 +02:00
val, err := r.ReadByte()
2021-08-26 15:08:24 +02:00
if err != nil {
return err
}
2021-10-01 22:18:48 +02:00
p.value = &val
return nil
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type PublishPacketProperties struct {
2021-10-01 22:18:48 +02:00
PayloadFormatIndicator PayloadFormatIndicator
MessageExpiryInterval MessageExpiryInterval
ContentType ContentType
ResponseTopic ResponseTopic
CorrelationData CorrelationData
SubscriptionIdentifier SubscriptionIdentifier
TopicAlias TopicAlias
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *PublishPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.PayloadFormatIndicator,
&p.MessageExpiryInterval,
&p.ContentType,
&p.ResponseTopic,
&p.CorrelationData,
&p.SubscriptionIdentifier,
&p.TopicAlias,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type WillProperties struct {
2021-10-01 22:18:48 +02:00
PayloadFormatIndicator PayloadFormatIndicator
MessageExpiryInterval MessageExpiryInterval
ContentType ContentType
ResponseTopic ResponseTopic
CorrelationData CorrelationData
WillDelayInterval WillDelayInterval
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *WillProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.PayloadFormatIndicator,
&p.MessageExpiryInterval,
&p.ContentType,
&p.ResponseTopic,
&p.CorrelationData,
&p.WillDelayInterval,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type SubscribePacketProperties struct {
2021-10-01 22:18:48 +02:00
SubscriptionIdentifier SubscriptionIdentifier
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *SubscribePacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.SubscriptionIdentifier,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type ConnectPacketProperties struct {
2021-10-01 22:18:48 +02:00
SessionExpiryInterval SessionExpiryInterval
AuthenticationMethod AuthenticationMethod
AuthenticationData AuthenticationData
RequestProblemInformation RequestProblemInformation
RequestResponseInformation RequestResponseInformation
ReceiveMaximum ReceiveMaximum
TopicAliasMaximum TopicAliasMaximum
UserProperty UserProperty
MaximumPacketSize MaximumPacketSize
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *ConnectPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.SessionExpiryInterval,
&p.AuthenticationMethod,
&p.AuthenticationData,
&p.RequestProblemInformation,
&p.RequestResponseInformation,
&p.ReceiveMaximum,
&p.TopicAliasMaximum,
&p.UserProperty,
&p.MaximumPacketSize,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type ConnackPacketProperties struct {
2021-10-01 22:18:48 +02:00
SessionExpiryInterval SessionExpiryInterval
AssignedClientIdentifier AssignedClientIdentifier
ServerKeepAlive ServerKeepAlive
AuthenticationMethod AuthenticationMethod
AuthenticationData AuthenticationData
ResponseInformation ResponseInformation
ServerReference ServerReference
ReasonString ReasonString
ReceiveMaximum ReceiveMaximum
TopicAliasMaximum TopicAliasMaximum
MaximumQoS MaximumQoS
RetainAvailable RetainAvailable
UserProperty UserProperty
MaximumPacketSize MaximumPacketSize
WildcardSubscriptionAvailable WildcardSubscriptionAvailable
SubscriptionIdentifierAvailable SubscriptionIdentifierAvailable
SharedSubscriptionAvailable SharedSubscriptionAvailable
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *ConnackPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.SessionExpiryInterval,
&p.AssignedClientIdentifier,
&p.ServerKeepAlive,
&p.AuthenticationMethod,
&p.AuthenticationData,
&p.ResponseInformation,
&p.ServerReference,
&p.ReasonString,
&p.ReceiveMaximum,
&p.TopicAliasMaximum,
&p.MaximumQoS,
&p.RetainAvailable,
&p.UserProperty,
&p.MaximumPacketSize,
&p.WildcardSubscriptionAvailable,
&p.SubscriptionIdentifierAvailable,
&p.SharedSubscriptionAvailable,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type DisconnectPacketProperties struct {
2021-10-01 22:18:48 +02:00
SessionExpiryInterval SessionExpiryInterval
ServerReference ServerReference
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *DisconnectPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.SessionExpiryInterval,
&p.ServerReference,
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type AuthPacketProperties struct {
2021-10-01 22:18:48 +02:00
AuthenticationMethod AuthenticationMethod
AuthenticationData AuthenticationData
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *AuthPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.AuthenticationMethod,
&p.AuthenticationData,
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type PubackPacketProperties struct {
2021-10-01 22:18:48 +02:00
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *PubackPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type PubrecPacketProperties struct {
2021-10-01 22:18:48 +02:00
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *PubrecPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type PubrelPacketProperties struct {
2021-10-01 22:18:48 +02:00
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *PubrelPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type PubcompPacketProperties struct {
2021-10-01 22:18:48 +02:00
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *PubcompPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type SubackPacketProperties struct {
2021-10-01 22:18:48 +02:00
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *SubackPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type UnsubackPacketProperties struct {
2021-10-01 22:18:48 +02:00
ReasonString ReasonString
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *UnsubackPacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.ReasonString,
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
type UnsubscribePacketProperties struct {
2021-10-01 22:18:48 +02:00
UserProperty UserProperty
2021-08-26 15:08:24 +02:00
}
2021-10-01 22:18:48 +02:00
2021-08-26 15:08:24 +02:00
func (p *UnsubscribePacketProperties) arrayOf() []Property {
2021-10-01 22:18:48 +02:00
return []Property{
&p.UserProperty,
}
2021-08-26 15:08:24 +02:00
}