Files
meshstream/mqtt/packet.go
2025-04-21 18:27:55 -07:00

18 lines
367 B
Go

package mqtt
import (
meshtreampb "meshstream/generated/meshstream"
)
// Type alias for proto packet.
type Packet meshtreampb.Packet
// NewPacket creates a Packet from a data packet and topic info
func NewPacket(data *meshtreampb.Data, topicInfo *meshtreampb.TopicInfo) *Packet {
p := Packet(meshtreampb.Packet{
Data: data,
Info: topicInfo,
})
return &p
}