encoder

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Encode         = encoder.Encode
	EncodeIndented = encoder.EncodeIndented
	EncodeInto     = encoder.EncodeInto
	HTMLEscape     = encoder.HTMLEscape
	Pretouch       = encoder.Pretouch
	Quote          = encoder.Quote
	Valid          = encoder.Valid
)
View Source
var NewStreamEncoder = encoder.NewStreamEncoder

Functions

This section is empty.

Types

type Encoder

type Encoder = encoder.Encoder

type Options

type Options = encoder.Options
const (
	// SortMapKeys indicates that the keys of a map needs to be sorted
	// before serializing into JSON.
	// WARNING: This hurts performance A LOT, USE WITH CARE.
	SortMapKeys Options = encoder.SortMapKeys

	// EscapeHTML indicates encoder to escape all HTML characters
	// after serializing into JSON (see https://pkg.go.dev/encoding/json#HTMLEscape).
	// WARNING: This hurts performance A LOT, USE WITH CARE.
	EscapeHTML Options = encoder.EscapeHTML

	// CompactMarshaler indicates that the output JSON from json.Marshaler
	// is always compact and needs no validation
	CompactMarshaler Options = encoder.CompactMarshaler

	// NoQuoteTextMarshaler indicates that the output text from encoding.TextMarshaler
	// is always escaped string and needs no quoting
	NoQuoteTextMarshaler Options = encoder.NoQuoteTextMarshaler

	// NoNullSliceOrMap indicates all empty Array or Object are encoded as '[]' or '{}',
	// instead of 'null'
	NoNullSliceOrMap Options = encoder.NoNullSliceOrMap

	// ValidateString indicates that encoder should validate the input string
	// before encoding it into JSON.
	ValidateString Options = encoder.ValidateString

	// CompatibleWithStd is used to be compatible with std encoder.
	CompatibleWithStd Options = encoder.CompatibleWithStd
)

type StreamEncoder added in v1.3.0

type StreamEncoder = encoder.StreamEncoder

Jump to

Keyboard shortcuts

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