diff --git a/protocol/packet/packet.go b/protocol/packet/packet.go index 579d145..95527fc 100644 --- a/protocol/packet/packet.go +++ b/protocol/packet/packet.go @@ -16,7 +16,15 @@ import ( ) type Packet struct { - Id uint64 - Type string - Body json.RawMessage + Id uint64 `json:"id"` + Type string `json:"type"` + Body json.RawMessage `json:"body"` + auxBody interface{} +} + +func New(typ string, body interface{}) *Packet { + return &Packet{ + Type: typ, + auxBody: body, + } }