jsonencoder

package
v0.0.0-...-eb4175f Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package jsonencoder References encoding/json/tables.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func New

func New(bufLen int) *Encoder

New return an Encoder. TODO: Add escapeHTML in func arguments.

func (*Encoder) AppendArrayBegin

func (enc *Encoder) AppendArrayBegin()

AppendArrayBegin can be used for begin of array and slice.

func (*Encoder) AppendArrayEnd

func (enc *Encoder) AppendArrayEnd()

AppendArrayEnd can be used for end of array and slice.

func (*Encoder) AppendLiteralBool

func (enc *Encoder) AppendLiteralBool(v bool, quote bool)

AppendLiteralBool can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralBytes

func (enc *Encoder) AppendLiteralBytes(v []byte)

AppendLiteralBytes can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralFloat32

func (enc *Encoder) AppendLiteralFloat32(v float32, quote bool)

AppendLiteralFloat32 can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralFloat64

func (enc *Encoder) AppendLiteralFloat64(v float64, quote bool)

AppendLiteralFloat64 can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralInt32

func (enc *Encoder) AppendLiteralInt32(v int32, quote bool)

AppendLiteralInt32 can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralInt64

func (enc *Encoder) AppendLiteralInt64(v int64, quote bool)

AppendLiteralInt64 can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralInterface

func (enc *Encoder) AppendLiteralInterface(v interface{}) error

AppendLiteralInterface can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralNULL

func (enc *Encoder) AppendLiteralNULL()

AppendLiteralNULL can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralString

func (enc *Encoder) AppendLiteralString(v string)

AppendLiteralString can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralUint32

func (enc *Encoder) AppendLiteralUint32(v uint32, quote bool)

AppendLiteralUint32 can be used for value of literal, slice, array and map.

func (*Encoder) AppendLiteralUint64

func (enc *Encoder) AppendLiteralUint64(v uint64, quote bool)

AppendLiteralUint64 can be used for value of literal, slice, array and map.

func (*Encoder) AppendMapKeyBool

func (enc *Encoder) AppendMapKeyBool(v bool, quote bool)

func (*Encoder) AppendMapKeyInt32

func (enc *Encoder) AppendMapKeyInt32(v int32, quote bool)

func (*Encoder) AppendMapKeyInt64

func (enc *Encoder) AppendMapKeyInt64(v int64, quote bool)

func (*Encoder) AppendMapKeyString

func (enc *Encoder) AppendMapKeyString(v string)

func (*Encoder) AppendMapKeyUInt32

func (enc *Encoder) AppendMapKeyUInt32(v uint32, quote bool)

func (*Encoder) AppendMapKeyUInt64

func (enc *Encoder) AppendMapKeyUInt64(v uint64, quote bool)

func (*Encoder) AppendObjectBegin

func (enc *Encoder) AppendObjectBegin()

AppendObjectBegin can be used for begin of JSON, map and struct.

func (*Encoder) AppendObjectEnd

func (enc *Encoder) AppendObjectEnd()

AppendObjectEnd can be used for end of JSON, map and struct.

func (*Encoder) AppendObjectKey

func (enc *Encoder) AppendObjectKey(k string)

func (*Encoder) AppendPointerBool

func (enc *Encoder) AppendPointerBool(v *bool, quote bool)

AppendPointerBool can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerFloat32

func (enc *Encoder) AppendPointerFloat32(v *float32, quote bool)

AppendPointerFloat32 can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerFloat64

func (enc *Encoder) AppendPointerFloat64(v *float64, quote bool)

AppendPointerFloat64 can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerInt32

func (enc *Encoder) AppendPointerInt32(v *int32, quote bool)

AppendPointerInt32 can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerInt64

func (enc *Encoder) AppendPointerInt64(v *int64, quote bool)

AppendPointerInt64 can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerString

func (enc *Encoder) AppendPointerString(v *string)

AppendPointerString can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerUint32

func (enc *Encoder) AppendPointerUint32(v *uint32, quote bool)

AppendPointerUint32 can be used for value of literal, slice, array and map.

func (*Encoder) AppendPointerUint64

func (enc *Encoder) AppendPointerUint64(v *uint64, quote bool)

AppendPointerUint64 can be used for value of literal, slice, array and map.

func (*Encoder) AppendWKTAnyByProto

func (enc *Encoder) AppendWKTAnyByProto(v *any.Any) error

func (*Encoder) Bytes

func (enc *Encoder) Bytes() []byte

Bytes Implements encoder.

func (*Encoder) Write

func (enc *Encoder) Write(p []byte) (n int, err error)

Impls interface io.Writer

Jump to

Keyboard shortcuts

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