Documentation
¶
Overview ¶
Package goccyjson contains a fast replacement for encoding/json.
Index ¶
- type CodecJSON
- func (j *CodecJSON) ContentTypes() []string
- func (j *CodecJSON) Exts() []string
- func (j *CodecJSON) Marshal(v any) ([]byte, error)
- func (j *CodecJSON) Marshals(_ any) bool
- func (j *CodecJSON) Name() string
- func (j *CodecJSON) NewDecoder(r io.Reader) codecs.Decoder
- func (j *CodecJSON) NewEncoder(w io.Writer) codecs.Encoder
- func (j *CodecJSON) Unmarshal(data []byte, v any) error
- func (j *CodecJSON) Unmarshals(_ any) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodecJSON ¶
type CodecJSON struct{}
CodecJSON implements the codecs.Marshal interface, and can be used for marshaling CodecJSON config files, and web requests.
func (*CodecJSON) ContentTypes ¶
ContentTypes returns the content types the marshaler can handle.
func (*CodecJSON) Marshal ¶ added in v0.2.0
Marshal marshals any object into json bytes. Param v should be a pointer type.
func (*CodecJSON) Marshals ¶ added in v0.2.0
Marshals returns if this is able to encode the given type.
func (*CodecJSON) NewDecoder ¶
NewDecoder returns a Decoder which reads byte sequence from "r".
func (*CodecJSON) NewEncoder ¶
NewEncoder returns an Encoder which writes bytes sequence into "w".
func (*CodecJSON) Unmarshal ¶ added in v0.2.0
Unmarshal decodes json bytes into object v. Param v should be a pointer type.
func (*CodecJSON) Unmarshals ¶ added in v0.2.0
Unmarshals returns if this is able to decode the given type.