jsoncodec

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SonicJSON

type SonicJSON struct {
	Config        sonic.Config
	ConfigDefault sonic.API
}

SonicJSON Wrap sonic 默认sonic不支持html逃逸转义和SortKeys,有需要的场景自定义设置

func SonicJsonDefault

func SonicJsonDefault() *SonicJSON

SonicJsonDefault sonic ConfigDefault

func SonicJsonEscape

func SonicJsonEscape() *SonicJSON

SonicJsonEscape just start HTML escape

func SonicJsonFastest

func SonicJsonFastest() *SonicJSON

SonicJsonFastest sonic ConfigFastest

func SonicJsonSortEscape

func SonicJsonSortEscape() *SonicJSON

SonicJsonSortEscape just start Keys Sort & HTML escape

func SonicJsonStd

func SonicJsonStd() *SonicJSON

SonicJsonStd sonic ConfigStd

func (*SonicJSON) Marshal

func (s *SonicJSON) Marshal(v interface{}) ([]byte, error)

Marshal use Sonic Marshal

func (*SonicJSON) SetCfg

func (s *SonicJSON) SetCfg(cfg ...sonic.Config) *SonicJSON

SetCfg set sonic config

func (*SonicJSON) Unmarshal

func (s *SonicJSON) Unmarshal(data []byte, v interface{}) error

Unmarshal use Sonic Unmarshal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL