mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-11-03 10:31:11 +08:00
27 lines
573 B
Go
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
|
|
}
|