kubernetes/vendor/go.uber.org/zap/zapcore/json_encoder.go

const _hex

var _jsonPool

func putJSONEncoder(enc *jsonEncoder) {}

type jsonEncoder

// NewJSONEncoder creates a fast, low-allocation JSON encoder. The encoder
// appropriately escapes all field keys and values.
//
// Note that the encoder doesn't deduplicate keys, so it's possible to produce
// a message like
//
//	{"foo":"bar","foo":"baz"}
//
// This is permitted by the JSON specification, but not encouraged. Many
// libraries will ignore duplicate key-value pairs (typically keeping the last
// pair) when unmarshaling, but users should attempt to avoid adding duplicate
// keys.
func NewJSONEncoder(cfg EncoderConfig) Encoder {}

func newJSONEncoder(cfg EncoderConfig, spaced bool) *jsonEncoder {}

func (enc *jsonEncoder) AddArray(key string, arr ArrayMarshaler) error {}

func (enc *jsonEncoder) AddObject(key string, obj ObjectMarshaler) error {}

func (enc *jsonEncoder) AddBinary(key string, val []byte) {}

func (enc *jsonEncoder) AddByteString(key string, val []byte) {}

func (enc *jsonEncoder) AddBool(key string, val bool) {}

func (enc *jsonEncoder) AddComplex128(key string, val complex128) {}

func (enc *jsonEncoder) AddComplex64(key string, val complex64) {}

func (enc *jsonEncoder) AddDuration(key string, val time.Duration) {}

func (enc *jsonEncoder) AddFloat64(key string, val float64) {}

func (enc *jsonEncoder) AddFloat32(key string, val float32) {}

func (enc *jsonEncoder) AddInt64(key string, val int64) {}

func (enc *jsonEncoder) resetReflectBuf() {}

var nullLiteralBytes

// Only invoke the standard JSON encoder if there is actually something to
// encode; otherwise write JSON null literal directly.
func (enc *jsonEncoder) encodeReflected(obj interface{}

func (enc *jsonEncoder) AddReflected(key string, obj interface{}

func (enc *jsonEncoder) OpenNamespace(key string) {}

func (enc *jsonEncoder) AddString(key, val string) {}

func (enc *jsonEncoder) AddTime(key string, val time.Time) {}

func (enc *jsonEncoder) AddUint64(key string, val uint64) {}

func (enc *jsonEncoder) AppendArray(arr ArrayMarshaler) error {}

func (enc *jsonEncoder) AppendObject(obj ObjectMarshaler) error {}

func (enc *jsonEncoder) AppendBool(val bool) {}

func (enc *jsonEncoder) AppendByteString(val []byte) {}

// appendComplex appends the encoded form of the provided complex128 value.
// precision specifies the encoding precision for the real and imaginary
// components of the complex number.
func (enc *jsonEncoder) appendComplex(val complex128, precision int) {}

func (enc *jsonEncoder) AppendDuration(val time.Duration) {}

func (enc *jsonEncoder) AppendInt64(val int64) {}

func (enc *jsonEncoder) AppendReflected(val interface{}

func (enc *jsonEncoder) AppendString(val string) {}

func (enc *jsonEncoder) AppendTimeLayout(time time.Time, layout string) {}

func (enc *jsonEncoder) AppendTime(val time.Time) {}

func (enc *jsonEncoder) AppendUint64(val uint64) {}

func (enc *jsonEncoder) AddInt(k string, v int)         {}

func (enc *jsonEncoder) AddInt32(k string, v int32)     {}

func (enc *jsonEncoder) AddInt16(k string, v int16)     {}

func (enc *jsonEncoder) AddInt8(k string, v int8)       {}

func (enc *jsonEncoder) AddUint(k string, v uint)       {}

func (enc *jsonEncoder) AddUint32(k string, v uint32)   {}

func (enc *jsonEncoder) AddUint16(k string, v uint16)   {}

func (enc *jsonEncoder) AddUint8(k string, v uint8)     {}

func (enc *jsonEncoder) AddUintptr(k string, v uintptr) {}

func (enc *jsonEncoder) AppendComplex64(v complex64)    {}

func (enc *jsonEncoder) AppendComplex128(v complex128)  {}

func (enc *jsonEncoder) AppendFloat64(v float64)        {}

func (enc *jsonEncoder) AppendFloat32(v float32)        {}

func (enc *jsonEncoder) AppendInt(v int)                {}

func (enc *jsonEncoder) AppendInt32(v int32)            {}

func (enc *jsonEncoder) AppendInt16(v int16)            {}

func (enc *jsonEncoder) AppendInt8(v int8)              {}

func (enc *jsonEncoder) AppendUint(v uint)              {}

func (enc *jsonEncoder) AppendUint32(v uint32)          {}

func (enc *jsonEncoder) AppendUint16(v uint16)          {}

func (enc *jsonEncoder) AppendUint8(v uint8)            {}

func (enc *jsonEncoder) AppendUintptr(v uintptr)        {}

func (enc *jsonEncoder) Clone() Encoder {}

func (enc *jsonEncoder) clone() *jsonEncoder {}

func (enc *jsonEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, error) {}

func (enc *jsonEncoder) truncate() {}

func (enc *jsonEncoder) closeOpenNamespaces() {}

func (enc *jsonEncoder) addKey(key string) {}

func (enc *jsonEncoder) addElementSeparator() {}

func (enc *jsonEncoder) appendFloat(val float64, bitSize int) {}

// safeAddString JSON-escapes a string and appends it to the internal buffer.
// Unlike the standard library's encoder, it doesn't attempt to protect the
// user from browser vulnerabilities or JSONP-related problems.
func (enc *jsonEncoder) safeAddString(s string) {}

// safeAddByteString is no-alloc equivalent of safeAddString(string(s)) for s []byte.
func (enc *jsonEncoder) safeAddByteString(s []byte) {}

// safeAppendStringLike is a generic implementation of safeAddString and safeAddByteString.
// It appends a string or byte slice to the buffer, escaping all special characters.
func safeAppendStringLike[S []byte | string](
	// appendTo appends this string-like object to the buffer.
	appendTo func(*buffer.Buffer, S),
	// decodeRune decodes the next rune from the string-like object
	// and returns its value and width in bytes.
	decodeRune func(S) (rune, int),
	buf *buffer.Buffer,
	s S,
) {}