goccyjson

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Overview

Package goccyjson contains a fast replacement for encoding/json.

Index

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

func (j *CodecJSON) ContentTypes() []string

ContentTypes returns the content types the marshaler can handle.

func (*CodecJSON) Exts

func (j *CodecJSON) Exts() []string

Exts is a list of file extensions this marshaler supports.

func (*CodecJSON) Marshal added in v0.2.0

func (j *CodecJSON) Marshal(v any) ([]byte, error)

Marshal marshals any object into json bytes. Param v should be a pointer type.

func (*CodecJSON) Marshals added in v0.2.0

func (j *CodecJSON) Marshals(_ any) bool

Marshals returns if this is able to encode the given type.

func (*CodecJSON) Name added in v0.2.0

func (j *CodecJSON) Name() string

Name returns the codec name.

func (*CodecJSON) NewDecoder

func (j *CodecJSON) NewDecoder(r io.Reader) codecs.Decoder

NewDecoder returns a Decoder which reads byte sequence from "r".

func (*CodecJSON) NewEncoder

func (j *CodecJSON) NewEncoder(w io.Writer) codecs.Encoder

NewEncoder returns an Encoder which writes bytes sequence into "w".

func (*CodecJSON) Unmarshal added in v0.2.0

func (j *CodecJSON) Unmarshal(data []byte, v any) error

Unmarshal decodes json bytes into object v. Param v should be a pointer type.

func (*CodecJSON) Unmarshals added in v0.2.0

func (j *CodecJSON) Unmarshals(_ any) bool

Unmarshals returns if this is able to decode the given type.

Jump to

Keyboard shortcuts

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