json

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package json provides a json codec

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMarshalOptions = JsonMarshalOptions{
		EscapeHTML:  true,
		SortMapKeys: true,
	}

	DefaultUnmarshalOptions = JsonUnmarshalOptions{
		ZeroCopy: true,
	}
)

Functions

func MarshalOptions

func MarshalOptions(o JsonMarshalOptions) codec.Option

func NewCodec

func NewCodec(opts ...codec.Option) *jsonCodec

func UnmarshalOptions

func UnmarshalOptions(o JsonUnmarshalOptions) codec.Option

Types

type JsonMarshalOptions

type JsonMarshalOptions struct {
	EscapeHTML      bool
	SortMapKeys     bool
	TrustRawMessage bool
}

type JsonUnmarshalOptions

type JsonUnmarshalOptions struct {
	DisallowUnknownFields                bool
	DontCopyNumber                       bool
	DontCopyRawMessage                   bool
	DontCopyString                       bool
	DontMatchCaseInsensitiveStructFields bool
	UseNumber                            bool
	ZeroCopy                             bool
}

Jump to

Keyboard shortcuts

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