From b5071eb15b1a93fc662f084cfbd455564c56a7ff Mon Sep 17 00:00:00 2001 From: wuko233 Date: Mon, 16 Feb 2026 15:54:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EPacket=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93=E5=8F=8A=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E7=BD=91=E7=BB=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8C=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/network/types.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 internal/network/types.go diff --git a/internal/network/types.go b/internal/network/types.go new file mode 100644 index 0000000..9a50c6a --- /dev/null +++ b/internal/network/types.go @@ -0,0 +1,17 @@ +package network + +import "time" + +type Packet struct { + Type string `json:"type"` + Timestamp int64 `json:"timestamp"` + Payload interface{} `json:"payload"` +} + +func NewPactet(msgType string, payload interface{}) Packet { + return Packet{ + Type: msgType, + Timestamp: time.Now().Unix(), + Payload: payload, + } +}