Files
mochi-mqtt/packets/disconnect.go
2019-09-22 16:17:42 +01:00

27 lines
573 B
Go

package packets
import (
"bytes"
)
// DisconnectPacket contains the values of an MQTT DISCONNECT packet.
type DisconnectPacket struct {
FixedHeader
}
// Encode encodes and writes the packet data values to the buffer.
func (pk *DisconnectPacket) Encode(buf *bytes.Buffer) error {
pk.FixedHeader.encode(buf)
return nil
}
// Decode extracts the data values from the packet.
func (pk *DisconnectPacket) Decode(buf []byte) error {
return nil
}
// Validate ensures the packet is compliant.
func (pk *DisconnectPacket) Validate() (byte, error) {
return Accepted, nil
}