Skip to content

Commit

Permalink
(update): Added mapstruct and msgpack support for struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
zishang520 committed Sep 18, 2023
1 parent 544f7d1 commit 9097323
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packet/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 9097323

Please sign in to comment.