Documentation
¶
Index ¶
- type SonicJSON
- func (s *SonicJSON) Marshal(v interface{}) ([]byte, error)
- func (s *SonicJSON) MarshalIndent(v any, prefix, indent string) ([]byte, error)
- func (s *SonicJSON) NewDecoder(reader io.Reader) ginJson.Decoder
- func (s *SonicJSON) NewEncoder(writer io.Writer) ginJson.Encoder
- func (s *SonicJSON) SetCfg(cfg ...sonic.Config) *SonicJSON
- func (s *SonicJSON) Unmarshal(data []byte, v interface{}) error
- type StdJSON
- func (s *StdJSON) Marshal(v interface{}) ([]byte, error)
- func (s *StdJSON) MarshalIndent(v any, prefix, indent string) ([]byte, error)
- func (s *StdJSON) NewDecoder(reader io.Reader) ginJson.Decoder
- func (s *StdJSON) NewEncoder(writer io.Writer) ginJson.Encoder
- func (s *StdJSON) Unmarshal(data []byte, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SonicJSON ¶
SonicJSON Wrap sonic 默认sonic不支持html逃逸转义和SortKeys,有需要的场景自定义设置
func SonicJsonSortEscape ¶
func SonicJsonSortEscape() *SonicJSON
SonicJsonSortEscape just start Keys Sort & HTML escape
func (*SonicJSON) MarshalIndent ¶
MarshalIndent use Sonic MarshalIndent
func (*SonicJSON) NewDecoder ¶
NewDecoder use Sonic NewDecoder
func (*SonicJSON) NewEncoder ¶
NewEncoder use Sonic NewEncoder
type StdJSON ¶
type StdJSON struct{}
StdJSON 使用标准库 encoding/json 的编解码实现
func (*StdJSON) MarshalIndent ¶
MarshalIndent 使用标准库 json.MarshalIndent
func (*StdJSON) NewDecoder ¶
NewDecoder 使用标准库 json.NewDecoder
func (*StdJSON) NewEncoder ¶
NewEncoder 使用标准库 json.NewEncoder
Click to show internal directories.
Click to hide internal directories.