From 909732362d80a7b55a4a15cec6ec17cf6a934b1f Mon Sep 17 00:00:00 2001 From: luoyy Date: Mon, 18 Sep 2023 16:06:16 +0800 Subject: [PATCH] (update): Added mapstruct and msgpack support for struct. --- packet/type.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packet/type.go b/packet/type.go index e66c306..f8764af 100644 --- a/packet/type.go +++ b/packet/type.go @@ -21,12 +21,12 @@ const ( ) type Options struct { - Compress bool `json:"compress"` + Compress bool `json:"compress" mapstructure:"compress" msgpack:"compress"` } type Packet struct { - Type Type `json:"type"` - Data io.Reader `json:"data,omitempty"` - Options *Options `json:"options,omitempty"` - WsPreEncoded types.BufferInterface `json:"wsPreEncoded,omitempty"` + Type Type `json:"type" mapstructure:"type" msgpack:"type"` + Data io.Reader `json:"data,omitempty" mapstructure:"data,omitempty" msgpack:"data,omitempty"` + Options *Options `json:"options,omitempty" mapstructure:"options,omitempty" msgpack:"options,omitempty"` + WsPreEncoded types.BufferInterface `json:"wsPreEncoded,omitempty" mapstructure:"wsPreEncoded,omitempty" msgpack:"wsPreEncoded,omitempty"` }