mirror of
https://github.com/dpup/meshstream.git
synced 2026-03-28 17:42:37 +01:00
18 lines
367 B
Go
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
|
|
}
|