DecodeObjectFunc is a func type implementing UnmarshalerJSONObject.
Use it to cast a `func(*Decoder, k string) error` to Unmarshal an object on the fly. NKeys implements UnmarshalerJSONObject. UnmarshalJSONObject implements UnmarshalerJSONObject.
DecodeObjectFunc : UnmarshalerJSONObject
A Decoder reads and decodes JSON values from an input stream. AddArray decodes the JSON value within an object or an array to a UnmarshalerJSONArray. AddArrayNull decodes the JSON value within an object or an array to a UnmarshalerJSONArray. AddBool decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false. AddBoolNull decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false.
If a `null` is encountered, gojay does not change the value of the pointer. AddEmbeddedJSON adds an EmbeddedsJSON to the value pointed by v.
It can be used to delay JSON decoding or precompute a JSON encoding. AddFloat decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. AddFloat32 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. AddFloat32Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddFloat64 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. AddFloat64Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddFloatNull decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned. AddInt16 decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned. AddInt16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt32 decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned. AddInt32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt64 decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned. AddInt64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt8 decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned. AddInt8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddIntNull decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInterface decodes the JSON value within an object or an array to a interface{}. AddObject decodes the JSON value within an object or an array to a UnmarshalerJSONObject. AddObjectNull decodes the JSON value within an object or an array to a UnmarshalerJSONObject. AddSQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool AddSQLNullFloat64 decodes the JSON value within an object or an array to qn *sql.NullFloat64 AddSQLNullInt64 decodes the JSON value within an object or an array to qn *sql.NullInt64 AddSQLNullString decodes the JSON value within an object or an array to qn *sql.NullString AddBool unmarshals the next JSON array of boolegers to the given *[]bool s AddFloat64 unmarshals the next JSON array of floats to the given *[]float64 s AddSliceInt unmarshals the next JSON array of integers to the given *[]int s AddSliceString unmarshals the next JSON array of strings to the given *[]string s AddString decodes the JSON value within an object or an array to a *string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned. AddStringNull decodes the JSON value within an object or an array to a *string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddTime decodes the JSON value within an object or an array to a *time.Time with the given format AddUint16 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned. AddUint16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddUint32 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned. AddUint32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddUint64 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned. AddUint64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddUint8 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned. AddUint8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. Array decodes the JSON value within an object or an array to a UnmarshalerJSONArray. ArrayNull decodes the JSON value within an object or an array to a UnmarshalerJSONArray.
v should be a pointer to an UnmarshalerJSONArray,
if `null` value is encountered in JSON, it will leave the value v untouched,
else it will create a new instance of the UnmarshalerJSONArray behind v. Bool decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false. BoolNull decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false. Decode reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value.
The differences between Decode and Unmarshal are:
- Decode reads from an io.Reader in the Decoder, whereas Unmarshal reads from a []byte
- Decode leaves to the user the option of borrowing and releasing a Decoder, whereas Unmarshal internally always borrows a Decoder and releases it when the unmarshaling is completed DecodeArray reads the next JSON-encoded value from the decoder's input (io.Reader)
and stores it in the value pointed to by v.
v must implement UnmarshalerJSONArray.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeBool reads the next JSON-encoded value from the decoder's input (io.Reader)
and stores it in the boolean pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeFloat32 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the float32 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeFloat64 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the float64 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt16 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int16 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt32 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int32 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt64 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int64 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt8 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int8 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInterface reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by i.
i must be an interface poiter DecodeObject reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by v.
v must implement UnmarshalerJSONObject.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeSQLNullBool decodes a sql.NullString with the given format DecodeSQLNullFloat64 decodes a sql.NullString with the given format DecodeSQLNullInt64 decodes a sql.NullInt64 DecodeSQLNullString decodes a sql.NullString DecodeString reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the string pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeTime decodes time with the given format DecodeUint16 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint16 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeUint32 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint32 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeUint64 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint64 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeUint8 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint8 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. EmbeddedJSON adds an EmbeddedsJSON to the value pointed by v.
It can be used to delay JSON decoding or precompute a JSON encoding. Float decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float32 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float32Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float64 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float64Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. FloatNull decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Index returns the index of an array being decoded. Int decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned. Int16 decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned. Int16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned. Int32 decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned. Int32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned. Int64 decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned. Int64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned. Int8 decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned. Int8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned. IntNull decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned. Interface decodes the JSON value within an object or an array to an interface{}. Object decodes the JSON value within an object or an array to a UnmarshalerJSONObject. ObjectNull decodes the JSON value within an object or an array to a UnmarshalerJSONObject.
v should be a pointer to an UnmarshalerJSONObject,
if `null` value is encountered in JSON, it will leave the value v untouched,
else it will create a new instance of the UnmarshalerJSONObject behind v. Release sends back a Decoder to the pool.
If a decoder is used after calling Release
a panic will be raised with an InvalidUsagePooledDecoderError error. SQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool SQLNullFloat64 decodes the JSON value within an object or an array to an *sql.NullFloat64 SQLNullInt64 decodes the JSON value within an object or an array to an *sql.NullInt64 SQLNullString decodes the JSON value within an object or an array to an *sql.NullString SliceBool unmarshals the next JSON array of boolegers to the given *[]bool s SliceFloat64 unmarshals the next JSON array of floats to the given *[]float64 s SliceInt unmarshals the next JSON array of integers to the given *[]int s SliceString unmarshals the next JSON array of strings to the given *[]string s String decodes the JSON value within an object or an array to a *string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned. StringNull decodes the JSON value within an object or an array to a **string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. Time decodes the JSON value within an object or an array to a *time.Time with the given format Uint16 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned. Uint16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned. Uint32 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned. Uint32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned. Uint64 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned. Uint64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned. Uint8 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned. Uint8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned.
*Decoder : github.com/grpc-ecosystem/grpc-gateway/v2/runtime.Decoder
func BorrowDecoder(r io.Reader) *Decoder
func NewDecoder(r io.Reader) *Decoder
func DecodeArrayFunc.UnmarshalJSONArray(dec *Decoder) error
func DecodeObjectFunc.UnmarshalJSONObject(dec *Decoder, k string) error
func UnmarshalerJSONArray.UnmarshalJSONArray(*Decoder) error
func UnmarshalerJSONObject.UnmarshalJSONObject(*Decoder, string) error
EncodeArrayFunc is a custom func type implementing MarshaleArray.
Use it to cast a func(*Encoder) to Marshal an object.
enc := gojay.NewEncoder(io.Writer)
enc.EncodeArray(gojay.EncodeArrayFunc(func(enc *gojay.Encoder) {
enc.AddStringKey("hello", "world")
})) IsNil implements MarshalerJSONArray. MarshalJSONArray implements MarshalerJSONArray.
EncodeArrayFunc : MarshalerJSONArray
EncodeObjectFunc is a custom func type implementing MarshaleObject.
Use it to cast a func(*Encoder) to Marshal an object.
enc := gojay.NewEncoder(io.Writer)
enc.EncodeObject(gojay.EncodeObjectFunc(func(enc *gojay.Encoder) {
enc.AddStringKey("hello", "world")
})) IsNil implements MarshalerJSONObject. MarshalJSONObject implements MarshalerJSONObject.
EncodeObjectFunc : MarshalerJSONObject
An Encoder writes JSON values to an output stream. AddArray adds an implementation of MarshalerJSONArray to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler AddArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key
value must implement Marshaler AddArrayKeyNullEmpty adds an array or slice to be encoded and skips it if it is nil.
Must be called inside an object as it will encode a key. `null` will be encoded` AddArrayKeyOmitEmpty adds an array or slice to be encoded and skips it if it is nil.
Must be called inside an object as it will encode a key. AddArrayNullEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler, if v is empty, `null` will be encoded` AddArrayOmitEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerAddArrayOmitEmpty AddBool adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) AddBoolKey adds a bool to be encoded, must be used inside an object as it will encode a key. AddBoolKeyNullEmpty adds a bool to be encoded and encodes `null` if it is zero value.
Must be used inside an object as it will encode a key. AddBoolKeyOmitEmpty adds a bool to be encoded and skips if it is zero value.
Must be used inside an object as it will encode a key. AddBoolNullEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) AddBoolOmitEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) AddEmbeddedJSON adds an EmbeddedJSON to be encoded.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddEmbeddedJSONKey adds an EmbeddedJSON and a key to be encoded.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddEmbeddedJSONKeyOmitEmpty adds an EmbeddedJSON and a key to be encoded or skips it if nil pointer or empty.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddEmbeddedJSONOmitEmpty adds an EmbeddedJSON to be encoded or skips it if nil pointer or empty.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddFloat adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key) AddFloat32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key) AddFloat32Key adds a float32 to be encoded, must be used inside an object as it will encode a key AddFloat32KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloat32KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloat32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloat32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloat64 adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key) AddFloat64Key adds a float64 to be encoded, must be used inside an object as it will encode a key AddFloat64KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloat64OmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloatKey adds a float64 to be encoded, must be used inside an object as it will encode a key AddFloatKeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloatKeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloatNullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloatOmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt16Key adds an int16 to be encoded, must be used inside an object as it will encode a key AddInt16KeyNullEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt16KeyOmitEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt32Key adds an int32 to be encoded, must be used inside an object as it will encode a key AddInt32KeyOmitEmpty adds an int32 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt64Key adds an int64 to be encoded, must be used inside an object as it will encode a key AddInt64KeyNullEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt64KeyOmitEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt8Key adds an int8 to be encoded, must be used inside an object as it will encode a key AddInt8KeyNullEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt8KeyOmitEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddIntKey adds an int to be encoded, must be used inside an object as it will encode a key AddIntKeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddIntKeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddIntNullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddIntOmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInterface adds an interface{} to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInterfaceKey adds an interface{} to be encoded, must be used inside an object as it will encode a key AddInterfaceKeyOmitEmpty adds an interface{} to be encoded, must be used inside an object as it will encode a key AddNull adds a `null` to be encoded. Must be used while encoding an array.` AddNullKey adds a `null` to be encoded. Must be used while encoding an array.` AddObject adds an object to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectKey adds a struct to be encoded, must be used inside an object as it will encode a key
value must implement MarshalerJSONObject AddObjectKeyNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectKeyOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddSQLNullBool adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullBoolKey adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullBoolKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullBoolKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullBoolOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullFloat64 adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullFloat64Key adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullFloat64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullFloat64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullFloat64NullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullFloat64OmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullInt64 adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullInt64Key adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullInt64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullInt64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullInt64NullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullInt64OmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullString adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullStringKey adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullStringNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullStringOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSliceBool marshals the given []bool s AddSliceBoolKey marshals the given []bool s AddSliceFloat64 marshals the given []float64 s AddSliceFloat64Key marshals the given []float64 s AddSliceInt marshals the given []int s AddSliceIntKey marshals the given []int s AddSliceString marshals the given []string s AddSliceStringKey marshals the given []string s AddString adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddStringKey adds a string to be encoded, must be used inside an object as it will encode a key AddStringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddStringNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddStringOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddTime adds an *time.Time to be encoded with the given format, must be used inside a slice or array encoding (does not encode a key) AddTimeKey adds an *time.Time to be encoded with the given format, must be used inside an object as it will encode a key AddUint16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint16Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint16KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint16KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint16NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint32Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint32KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint32KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint64Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint64KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint64KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint8Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint8KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint8KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AppendByte allows a modular usage by appending a single byte manually to the current state of the buffer. AppendBytes allows a modular usage by appending bytes manually to the current state of the buffer. AppendString appends a string to the buffer Array adds an implementation of MarshalerJSONArray to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler ArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key
value must implement Marshaler ArrayKeyNullEmpty adds an array or slice to be encoded and encodes `null`` if it is nil.
Must be called inside an object as it will encode a key. ArrayKeyOmitEmpty adds an array or slice to be encoded and skips if it is nil.
Must be called inside an object as it will encode a key. ArrayNullEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler ArrayOmitEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler Bool adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) BoolKey adds a bool to be encoded, must be used inside an object as it will encode a key. BoolKeyNullEmpty adds a bool to be encoded and skips it if it is zero value.
Must be used inside an object as it will encode a key. BoolKeyOmitEmpty adds a bool to be encoded and skips it if it is zero value.
Must be used inside an object as it will encode a key. BoolNullEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) BoolOmitEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) Buf returns the Encoder's buffer. Encode encodes a value to JSON.
If Encode cannot find a way to encode the type to JSON
it will return an InvalidMarshalError. EncodeArray encodes an implementation of MarshalerJSONArray to JSON EncodeBool encodes a bool to JSON EncodeEmbeddedJSON encodes an embedded JSON.
is basically sets the internal buf as the value pointed by v and calls the io.Writer.Write() EncodeFloat encodes a float64 to JSON EncodeFloat32 encodes a float32 to JSON EncodeInt encodes an int to JSON EncodeInt64 encodes an int64 to JSON EncodeObject encodes an object to JSON EncodeObjectKeys encodes an object to JSON EncodeSQLNullBool encodes a string to EncodeSQLNullFloat64 encodes a string to EncodeSQLNullInt64 encodes a string to EncodeSQLNullString encodes a string to EncodeString encodes a string to EncodeTime encodes a *time.Time to JSON with the given format EncodeUint64 encodes an int64 to JSON Float adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key) Float32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key) Float32Key adds a float32 to be encoded, must be used inside an object as it will encode a key Float32KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key Float32KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key Float32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float64 adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key) Float64Key adds a float64 to be encoded, must be used inside an object as it will encode a key Float64KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float64KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key Float64NullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float64OmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). FloatKey adds a float64 to be encoded, must be used inside an object as it will encode a key FloatKeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key FloatKeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key FloatNullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). FloatOmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int16Key adds an int16 to be encoded, must be used inside an object as it will encode a key Int16KeyNullEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int16KeyOmitEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int16NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int32Key adds an int32 to be encoded, must be used inside an object as it will encode a key Int32KeyNullEmpty adds an int32 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int32KeyOmitEmpty adds an int32 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int64Key adds an int64 to be encoded, must be used inside an object as it will encode a key Int64KeyNullEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int64KeyOmitEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int8Key adds an int8 to be encoded, must be used inside an object as it will encode a key Int8KeyNullEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int8KeyOmitEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). IntKey adds an int to be encoded, must be used inside an object as it will encode a key IntKeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. IntKeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. IntNullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). IntOmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Null adds a `null` to be encoded. Must be used while encoding an array.` NullKey adds a `null` to be encoded. Must be used while encoding an array.` Object adds an object to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectKey adds a struct to be encoded, must be used inside an object as it will encode a key
value must implement MarshalerJSONObject ObjectKeyNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectKeyOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectKeyWithKeys adds a struct to be encoded, must be used inside an object as it will encode a key.
Value must implement MarshalerJSONObject. It will only encode the keys in keys. ObjectNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectWithKeys adds an object to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject. It will only encode the keys in keys. Release sends back a Encoder to the pool. SQLNullBool adds a string to be encoded, must be used inside an object as it will encode a key SQLNullBoolKey adds a string to be encoded, must be used inside an object as it will encode a key SQLNullBoolKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullBoolKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullBoolNullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullBoolOmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64 adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64Key adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullFloat64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullFloat64NullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64OmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64 adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64Key adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullInt64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullInt64NullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64OmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullString adds a string to be encoded, must be used inside an object as it will encode a key SQLNullStringKey adds a string to be encoded, must be used inside an object as it will encode a key SQLNullStringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullStringNullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullStringOmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SliceBool marshals the given []bool s SliceBoolKey marshals the given []bool s SliceFloat64 marshals the given []float64 s SliceFloat64Key marshals the given []float64 s SliceInt marshals the given []int s SliceIntKey marshals the given []int s SliceString marshals the given []string s SliceStringKey marshals the given []string s String adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) StringKey adds a string to be encoded, must be used inside an object as it will encode a key StringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key StringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key StringNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) StringOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) Time adds an *time.Time to be encoded with the given format, must be used inside a slice or array encoding (does not encode a key) TimeKey adds an *time.Time to be encoded with the given format, must be used inside an object as it will encode a key Uint16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint16Key adds an int to be encoded, must be used inside an object as it will encode a key Uint16KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint16KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint16NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint32Key adds an int to be encoded, must be used inside an object as it will encode a key Uint32KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint32KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint64Key adds an int to be encoded, must be used inside an object as it will encode a key Uint64KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint64KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint8Key adds an int to be encoded, must be used inside an object as it will encode a key Uint8KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint8KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Write writes to the io.Writer and resets the buffer.
*Encoder : github.com/grpc-ecosystem/grpc-gateway/v2/runtime.Encoder
*Encoder : go.uber.org/zap/zapcore.ReflectedEncoder
func BorrowEncoder(w io.Writer) *Encoder
func NewEncoder(w io.Writer) *Encoder
func EncodeArrayFunc.MarshalJSONArray(enc *Encoder)
func EncodeObjectFunc.MarshalJSONObject(enc *Encoder)
func MarshalerJSONArray.MarshalJSONArray(enc *Encoder)
func MarshalerJSONObject.MarshalJSONObject(enc *Encoder)
InvalidJSONError is a type representing an error returned when
Decoding encounters invalid JSON.( InvalidJSONError) Error() string
InvalidJSONError : error
InvalidMarshalError is a type representing an error returned when
Encoding did not find the proper way to encode( InvalidMarshalError) Error() string
InvalidMarshalError : error
InvalidUnmarshalError is a type representing an error returned when
Decoding cannot unmarshal JSON to the receiver type for various reasons.( InvalidUnmarshalError) Error() string
InvalidUnmarshalError : error
InvalidUsagePooledDecoderError is a type representing an error returned
when decoding is called on a still pooled Decoder( InvalidUsagePooledDecoderError) Error() string
InvalidUsagePooledDecoderError : error
InvalidUsagePooledEncoderError is a type representing an error returned
when decoding is called on a still pooled Encoder( InvalidUsagePooledEncoderError) Error() string
InvalidUsagePooledEncoderError : error
NoReaderError is a type representing an error returned when
decoding requires a reader and none was given( NoReaderError) Error() string
NoReaderError : error
A StreamDecoder reads and decodes JSON values from an input stream.
It implements conext.Context and provide a channel to notify interruption.Decoder*Decoder AddArray decodes the JSON value within an object or an array to a UnmarshalerJSONArray. AddArrayNull decodes the JSON value within an object or an array to a UnmarshalerJSONArray. AddBool decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false. AddBoolNull decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false.
If a `null` is encountered, gojay does not change the value of the pointer. AddEmbeddedJSON adds an EmbeddedsJSON to the value pointed by v.
It can be used to delay JSON decoding or precompute a JSON encoding. AddFloat decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. AddFloat32 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. AddFloat32Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddFloat64 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. AddFloat64Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddFloatNull decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned. AddInt16 decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned. AddInt16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt32 decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned. AddInt32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt64 decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned. AddInt64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInt8 decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned. AddInt8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddIntNull decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddInterface decodes the JSON value within an object or an array to a interface{}. AddObject decodes the JSON value within an object or an array to a UnmarshalerJSONObject. AddObjectNull decodes the JSON value within an object or an array to a UnmarshalerJSONObject. AddSQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool AddSQLNullFloat64 decodes the JSON value within an object or an array to qn *sql.NullFloat64 AddSQLNullInt64 decodes the JSON value within an object or an array to qn *sql.NullInt64 AddSQLNullString decodes the JSON value within an object or an array to qn *sql.NullString AddBool unmarshals the next JSON array of boolegers to the given *[]bool s AddFloat64 unmarshals the next JSON array of floats to the given *[]float64 s AddSliceInt unmarshals the next JSON array of integers to the given *[]int s AddSliceString unmarshals the next JSON array of strings to the given *[]string s AddString decodes the JSON value within an object or an array to a *string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned. AddStringNull decodes the JSON value within an object or an array to a *string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddTime decodes the JSON value within an object or an array to a *time.Time with the given format AddUint16 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned. AddUint16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddUint32 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned. AddUint32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddUint64 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned. AddUint64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. AddUint8 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned. AddUint8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. Array decodes the JSON value within an object or an array to a UnmarshalerJSONArray. ArrayNull decodes the JSON value within an object or an array to a UnmarshalerJSONArray.
v should be a pointer to an UnmarshalerJSONArray,
if `null` value is encountered in JSON, it will leave the value v untouched,
else it will create a new instance of the UnmarshalerJSONArray behind v. Bool decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false. BoolNull decodes the JSON value within an object or an array to a *bool.
If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
If next key is null, bool will be false. Deadline returns the time when work done on behalf of this context
should be canceled. Deadline returns ok==false when no deadline is
set. Successive calls to Deadline return the same results. Decode reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value.
The differences between Decode and Unmarshal are:
- Decode reads from an io.Reader in the Decoder, whereas Unmarshal reads from a []byte
- Decode leaves to the user the option of borrowing and releasing a Decoder, whereas Unmarshal internally always borrows a Decoder and releases it when the unmarshaling is completed DecodeArray reads the next JSON-encoded value from the decoder's input (io.Reader)
and stores it in the value pointed to by v.
v must implement UnmarshalerJSONArray.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeBool reads the next JSON-encoded value from the decoder's input (io.Reader)
and stores it in the boolean pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeFloat32 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the float32 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeFloat64 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the float64 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt16 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int16 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt32 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int32 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt64 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int64 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInt8 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the int8 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeInterface reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by i.
i must be an interface poiter DecodeObject reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by v.
v must implement UnmarshalerJSONObject.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeSQLNullBool decodes a sql.NullString with the given format DecodeSQLNullFloat64 decodes a sql.NullString with the given format DecodeSQLNullInt64 decodes a sql.NullInt64 DecodeSQLNullString decodes a sql.NullString DecodeStream reads the next line delimited JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by c.
c must implement UnmarshalerStream. Ideally c is a channel. See example for implementation.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeString reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the string pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeTime decodes time with the given format DecodeUint16 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint16 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeUint32 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint32 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeUint64 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint64 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. DecodeUint8 reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the uint8 pointed to by v.
See the documentation for Unmarshal for details about the conversion of JSON into a Go value. Done returns a channel that's closed when work is done.
It implements context.Context EmbeddedJSON adds an EmbeddedsJSON to the value pointed by v.
It can be used to delay JSON decoding or precompute a JSON encoding. Err returns nil if Done is not yet closed.
If Done is closed, Err returns a non-nil error explaining why.
It implements context.Context Float decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float32 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float32Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float64 decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Float64Null decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. FloatNull decodes the JSON value within an object or an array to a *float64.
If next key value overflows float64, an InvalidUnmarshalError error will be returned. Index returns the index of an array being decoded. Int decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned. Int16 decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned. Int16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int16, an InvalidUnmarshalError error will be returned. Int32 decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned. Int32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int32, an InvalidUnmarshalError error will be returned. Int64 decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned. Int64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int64, an InvalidUnmarshalError error will be returned. Int8 decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned. Int8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows int8, an InvalidUnmarshalError error will be returned. IntNull decodes the JSON value within an object or an array to an *int.
If next key value overflows int, an InvalidUnmarshalError error will be returned. Interface decodes the JSON value within an object or an array to an interface{}. Object decodes the JSON value within an object or an array to a UnmarshalerJSONObject. ObjectNull decodes the JSON value within an object or an array to a UnmarshalerJSONObject.
v should be a pointer to an UnmarshalerJSONObject,
if `null` value is encountered in JSON, it will leave the value v untouched,
else it will create a new instance of the UnmarshalerJSONObject behind v. Release sends back a Decoder to the pool.
If a decoder is used after calling Release
a panic will be raised with an InvalidUsagePooledDecoderError error. SQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool SQLNullFloat64 decodes the JSON value within an object or an array to an *sql.NullFloat64 SQLNullInt64 decodes the JSON value within an object or an array to an *sql.NullInt64 SQLNullString decodes the JSON value within an object or an array to an *sql.NullString SetDeadline sets the deadline SliceBool unmarshals the next JSON array of boolegers to the given *[]bool s SliceFloat64 unmarshals the next JSON array of floats to the given *[]float64 s SliceInt unmarshals the next JSON array of integers to the given *[]int s SliceString unmarshals the next JSON array of strings to the given *[]string s String decodes the JSON value within an object or an array to a *string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned. StringNull decodes the JSON value within an object or an array to a **string.
If next key is not a JSON string nor null, InvalidUnmarshalError will be returned.
If a `null` is encountered, gojay does not change the value of the pointer. Time decodes the JSON value within an object or an array to a *time.Time with the given format Uint16 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned. Uint16Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint16, an InvalidUnmarshalError error will be returned. Uint32 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned. Uint32Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint32, an InvalidUnmarshalError error will be returned. Uint64 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned. Uint64Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint64, an InvalidUnmarshalError error will be returned. Uint8 decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned. Uint8Null decodes the JSON value within an object or an array to an *int.
If next key value overflows uint8, an InvalidUnmarshalError error will be returned. Value implements context.Context
StreamDecoder : github.com/grpc-ecosystem/grpc-gateway/v2/runtime.Decoder
*StreamDecoder : context.Context
func UnmarshalerStream.UnmarshalStream(*StreamDecoder) error
A StreamEncoder reads and encodes values to JSON from an input stream.
It implements conext.Context and provide a channel to notify interruption.Encoder*Encoder AddArray adds an implementation of MarshalerJSONArray to be encoded. AddArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key
value must implement Marshaler AddArrayKeyNullEmpty adds an array or slice to be encoded and skips it if it is nil.
Must be called inside an object as it will encode a key. `null` will be encoded` AddArrayKeyOmitEmpty adds an array or slice to be encoded and skips it if it is nil.
Must be called inside an object as it will encode a key. AddArrayNullEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler, if v is empty, `null` will be encoded` AddArrayOmitEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerAddArrayOmitEmpty AddBool adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) AddBoolKey adds a bool to be encoded, must be used inside an object as it will encode a key. AddBoolKeyNullEmpty adds a bool to be encoded and encodes `null` if it is zero value.
Must be used inside an object as it will encode a key. AddBoolKeyOmitEmpty adds a bool to be encoded and skips if it is zero value.
Must be used inside an object as it will encode a key. AddBoolNullEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) AddBoolOmitEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) AddEmbeddedJSON adds an EmbeddedJSON to be encoded.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddEmbeddedJSONKey adds an EmbeddedJSON and a key to be encoded.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddEmbeddedJSONKeyOmitEmpty adds an EmbeddedJSON and a key to be encoded or skips it if nil pointer or empty.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddEmbeddedJSONOmitEmpty adds an EmbeddedJSON to be encoded or skips it if nil pointer or empty.
It basically blindly writes the bytes to the final buffer. Therefore,
it expects the JSON to be of proper format. AddFloat adds a float64 to be encoded. AddFloat32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key) AddFloat32Key adds a float32 to be encoded, must be used inside an object as it will encode a key AddFloat32KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloat32KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloat32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloat32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloat64 adds a float64 to be encoded. AddFloat64Key adds a float64 to be encoded, must be used inside an object as it will encode a key AddFloat64KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloat64OmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloatKey adds a float64 to be encoded, must be used inside an object as it will encode a key AddFloatKeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloatKeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key AddFloatNullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddFloatOmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt adds an int to be encoded. AddInt16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt16Key adds an int16 to be encoded, must be used inside an object as it will encode a key AddInt16KeyNullEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt16KeyOmitEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt32Key adds an int32 to be encoded, must be used inside an object as it will encode a key AddInt32KeyOmitEmpty adds an int32 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt64Key adds an int64 to be encoded, must be used inside an object as it will encode a key AddInt64KeyNullEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt64KeyOmitEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInt8Key adds an int8 to be encoded, must be used inside an object as it will encode a key AddInt8KeyNullEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt8KeyOmitEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddInt8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInt8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddIntKey adds an int to be encoded, must be used inside an object as it will encode a key AddIntKeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddIntKeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddIntNullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddIntOmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddInterface adds an interface{} to be encoded, must be used inside a slice or array encoding (does not encode a key) AddInterfaceKey adds an interface{} to be encoded, must be used inside an object as it will encode a key AddInterfaceKeyOmitEmpty adds an interface{} to be encoded, must be used inside an object as it will encode a key AddNull adds a `null` to be encoded. Must be used while encoding an array.` AddNullKey adds a `null` to be encoded. Must be used while encoding an array.` AddObject adds an object to be encoded.
value must implement MarshalerJSONObject. AddObjectKey adds a struct to be encoded, must be used inside an object as it will encode a key
value must implement MarshalerJSONObject AddObjectKeyNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectKeyOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddObjectOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject AddSQLNullBool adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullBoolKey adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullBoolKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullBoolKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullBoolOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullFloat64 adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullFloat64Key adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullFloat64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullFloat64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullFloat64NullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullFloat64OmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullInt64 adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullInt64Key adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullInt64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullInt64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullInt64NullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullInt64OmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullString adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) AddSQLNullStringKey adds a string to be encoded, must be used inside an object as it will encode a key AddSQLNullStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddSQLNullStringNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSQLNullStringOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddSliceBool marshals the given []bool s AddSliceBoolKey marshals the given []bool s AddSliceFloat64 marshals the given []float64 s AddSliceFloat64Key marshals the given []float64 s AddSliceInt marshals the given []int s AddSliceIntKey marshals the given []int s AddSliceString marshals the given []string s AddSliceStringKey marshals the given []string s AddString adds a string to be encoded. AddStringKey adds a string to be encoded, must be used inside an object as it will encode a key AddStringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key AddStringNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddStringOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) AddTime adds an *time.Time to be encoded with the given format, must be used inside a slice or array encoding (does not encode a key) AddTimeKey adds an *time.Time to be encoded with the given format, must be used inside an object as it will encode a key AddUint16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint16Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint16KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint16KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint16NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint32Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint32KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint32KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint64Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint64KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint64KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) AddUint8Key adds an int to be encoded, must be used inside an object as it will encode a key AddUint8KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint8KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. AddUint8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AddUint8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). AppendByte allows a modular usage by appending a single byte manually to the current state of the buffer. AppendBytes allows a modular usage by appending bytes manually to the current state of the buffer. AppendString appends a string to the buffer Array adds an implementation of MarshalerJSONArray to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler ArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key
value must implement Marshaler ArrayKeyNullEmpty adds an array or slice to be encoded and encodes `null`` if it is nil.
Must be called inside an object as it will encode a key. ArrayKeyOmitEmpty adds an array or slice to be encoded and skips if it is nil.
Must be called inside an object as it will encode a key. ArrayNullEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler ArrayOmitEmpty adds an array or slice to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement Marshaler Bool adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) BoolKey adds a bool to be encoded, must be used inside an object as it will encode a key. BoolKeyNullEmpty adds a bool to be encoded and skips it if it is zero value.
Must be used inside an object as it will encode a key. BoolKeyOmitEmpty adds a bool to be encoded and skips it if it is zero value.
Must be used inside an object as it will encode a key. BoolNullEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) BoolOmitEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) Buf returns the Encoder's buffer. Cancel cancels the consumers of the stream, interrupting the stream encoding.
After calling cancel, Done() will return a closed channel. CommaDelimited sets the delimiter to a comma.
It will add a new line after each JSON marshaled by the MarshalerStream Deadline returns the time when work done on behalf of this context
should be canceled. Deadline returns ok==false when no deadline is
set. Successive calls to Deadline return the same results. Done returns a channel that's closed when work is done.
It implements context.Context Encode encodes a value to JSON.
If Encode cannot find a way to encode the type to JSON
it will return an InvalidMarshalError. EncodeArray encodes an implementation of MarshalerJSONArray to JSON EncodeBool encodes a bool to JSON EncodeEmbeddedJSON encodes an embedded JSON.
is basically sets the internal buf as the value pointed by v and calls the io.Writer.Write() EncodeFloat encodes a float64 to JSON EncodeFloat32 encodes a float32 to JSON EncodeInt encodes an int to JSON EncodeInt64 encodes an int64 to JSON EncodeObject encodes an object to JSON EncodeObjectKeys encodes an object to JSON EncodeSQLNullBool encodes a string to EncodeSQLNullFloat64 encodes a string to EncodeSQLNullInt64 encodes a string to EncodeSQLNullString encodes a string to EncodeStream spins up a defined number of non blocking consumers of the MarshalerStream m.
m must implement MarshalerStream. Ideally m is a channel. See example for implementation.
See the documentation for Marshal for details about the conversion of Go value to JSON. EncodeString encodes a string to EncodeTime encodes a *time.Time to JSON with the given format EncodeUint64 encodes an int64 to JSON Err returns nil if Done is not yet closed.
If Done is closed, Err returns a non-nil error explaining why.
It implements context.Context Float adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key) Float32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key) Float32Key adds a float32 to be encoded, must be used inside an object as it will encode a key Float32KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key Float32KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key Float32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float64 adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key) Float64Key adds a float64 to be encoded, must be used inside an object as it will encode a key Float64KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float64KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key Float64NullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Float64OmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). FloatKey adds a float64 to be encoded, must be used inside an object as it will encode a key FloatKeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key FloatKeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key FloatNullEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). FloatOmitEmpty adds a float64 to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int16Key adds an int16 to be encoded, must be used inside an object as it will encode a key Int16KeyNullEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int16KeyOmitEmpty adds an int16 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int16NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int32Key adds an int32 to be encoded, must be used inside an object as it will encode a key Int32KeyNullEmpty adds an int32 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int32KeyOmitEmpty adds an int32 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int64Key adds an int64 to be encoded, must be used inside an object as it will encode a key Int64KeyNullEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int64KeyOmitEmpty adds an int64 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Int8Key adds an int8 to be encoded, must be used inside an object as it will encode a key Int8KeyNullEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int8KeyOmitEmpty adds an int8 to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Int8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Int8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). IntKey adds an int to be encoded, must be used inside an object as it will encode a key IntKeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. IntKeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. IntNullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). IntOmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). LineDelimited sets the delimiter to a new line character.
It will add a new line after each JSON marshaled by the MarshalerStream NConsumer sets the number of non blocking go routine to consume the stream. Null adds a `null` to be encoded. Must be used while encoding an array.` NullKey adds a `null` to be encoded. Must be used while encoding an array.` Object adds an object to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectKey adds a struct to be encoded, must be used inside an object as it will encode a key
value must implement MarshalerJSONObject ObjectKeyNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectKeyOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectKeyWithKeys adds a struct to be encoded, must be used inside an object as it will encode a key.
Value must implement MarshalerJSONObject. It will only encode the keys in keys. ObjectNullEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectOmitEmpty adds an object to be encoded or skips it if IsNil returns true.
Must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject ObjectWithKeys adds an object to be encoded, must be used inside a slice or array encoding (does not encode a key)
value must implement MarshalerJSONObject. It will only encode the keys in keys. Release sends back a Decoder to the pool.
If a decoder is used after calling Release
a panic will be raised with an InvalidUsagePooledDecoderError error. SQLNullBool adds a string to be encoded, must be used inside an object as it will encode a key SQLNullBoolKey adds a string to be encoded, must be used inside an object as it will encode a key SQLNullBoolKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullBoolKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullBoolNullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullBoolOmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64 adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64Key adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullFloat64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullFloat64NullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullFloat64OmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64 adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64Key adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullInt64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullInt64NullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullInt64OmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullString adds a string to be encoded, must be used inside an object as it will encode a key SQLNullStringKey adds a string to be encoded, must be used inside an object as it will encode a key SQLNullStringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key SQLNullStringNullEmpty adds a string to be encoded, must be used inside an object as it will encode a key SQLNullStringOmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key SetDeadline sets the deadline SliceBool marshals the given []bool s SliceBoolKey marshals the given []bool s SliceFloat64 marshals the given []float64 s SliceFloat64Key marshals the given []float64 s SliceInt marshals the given []int s SliceIntKey marshals the given []int s SliceString marshals the given []string s SliceStringKey marshals the given []string s String adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key) StringKey adds a string to be encoded, must be used inside an object as it will encode a key StringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key StringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside an object as it will encode a key StringNullEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) StringOmitEmpty adds a string to be encoded or skips it if it is zero value.
Must be used inside a slice or array encoding (does not encode a key) Time adds an *time.Time to be encoded with the given format, must be used inside a slice or array encoding (does not encode a key) TimeKey adds an *time.Time to be encoded with the given format, must be used inside an object as it will encode a key Uint16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint16Key adds an int to be encoded, must be used inside an object as it will encode a key Uint16KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint16KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint16NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint16OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint32Key adds an int to be encoded, must be used inside an object as it will encode a key Uint32KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint32KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint32NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint32OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint64Key adds an int to be encoded, must be used inside an object as it will encode a key Uint64KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint64KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint64NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint64OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key) Uint8Key adds an int to be encoded, must be used inside an object as it will encode a key Uint8KeyNullEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint8KeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
Must be used inside an object as it will encode a key. Uint8NullEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Uint8OmitEmpty adds an int to be encoded and skips it if its value is 0,
must be used inside a slice or array encoding (does not encode a key). Value implements context.Context Write writes to the io.Writer and resets the buffer.
StreamEncoder : github.com/grpc-ecosystem/grpc-gateway/v2/runtime.Encoder
*StreamEncoder : context.Context
StreamEncoder : go.uber.org/zap/zapcore.ReflectedEncoder
func (*StreamEncoder).CommaDelimited() *StreamEncoder
func (*StreamEncoder).LineDelimited() *StreamEncoder
func (*StreamEncoder).NConsumer(n int) *StreamEncoder
func MarshalerStream.MarshalStream(enc *StreamEncoder)
BorrowDecoder borrows a Decoder from the pool.
It takes an io.Reader implementation as data input.
In order to benefit from the pool, a borrowed decoder must be released after usage.
BorrowEncoder borrows an Encoder from the pool.
Marshal returns the JSON encoding of v.
If v is nil, not an implementation MarshalerJSONObject or MarshalerJSONArray or not one of the following types:
string, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float64, float32, bool
Marshal returns an InvalidMarshalError.
MarshalAny returns the JSON encoding of v.
If v is nil, not an implementation MarshalerJSONObject or MarshalerJSONArray or not one of the following types:
string, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float64, float32, bool
MarshalAny falls back to "json/encoding" package to marshal the value.
MarshalJSONArray returns the JSON encoding of v, an implementation of MarshalerJSONArray.
Example:
type TestSlice []*TestStruct
func (t TestSlice) MarshalJSONArray(enc *Encoder) {
for _, e := range t {
enc.AddObject(e)
}
}
func main() {
test := &TestSlice{
&TestStruct{123456},
&TestStruct{7890},
}
b, _ := Marshal(test)
fmt.Println(b) // [{"id":123456},{"id":7890}]
}
MarshalJSONObject returns the JSON encoding of v, an implementation of MarshalerJSONObject.
Example:
type Object struct {
id int
}
func (s *Object) MarshalJSONObject(enc *gojay.Encoder) {
enc.IntKey("id", s.id)
}
func (s *Object) IsNil() bool {
return s == nil
}
func main() {
test := &Object{
id: 123456,
}
b, _ := gojay.Marshal(test)
fmt.Println(b) // {"id":123456}
}
NewDecoder returns a new decoder.
It takes an io.Reader implementation as data input.
NewEncoder returns a new encoder or borrows one from the pool
Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v.
If v is nil, not an implementation of UnmarshalerJSONObject or UnmarshalerJSONArray or not one of the following types:
*string, **string, *int, **int, *int8, **int8, *int16, **int16, *int32, **int32, *int64, **int64, *uint8, **uint8, *uint16, **uint16,
*uint32, **uint32, *uint64, **uint64, *float64, **float64, *float32, **float32, *bool, **bool
Unmarshal returns an InvalidUnmarshalError.
If a JSON value is not appropriate for a given target type, or if a JSON number
overflows the target type, Unmarshal skips that field and completes the unmarshaling as best it can.
If no more serious errors are encountered, Unmarshal returns an UnmarshalTypeError describing the earliest such error.
In any case, it's not guaranteed that all the remaining fields following the problematic one will be unmarshaled into the target object.
UnmarshalJSONArray parses the JSON-encoded data and stores the result in the value pointed to by v.
v must implement UnmarshalerJSONArray.
If a JSON value is not appropriate for a given target type, or if a JSON number
overflows the target type, UnmarshalJSONArray skips that field and completes the unmarshaling as best it can.
UnmarshalJSONObject parses the JSON-encoded data and stores the result in the value pointed to by v.
v must implement UnmarshalerJSONObject.
If a JSON value is not appropriate for a given target type, or if a JSON number
overflows the target type, UnmarshalJSONObject skips that field and completes the unmarshaling as best it can.
Package-Level Variables (total 3)
ErrUnmarshalPtrExpected is the error returned when unmarshal expects a pointer value,
When using `dec.ObjectNull` or `dec.ArrayNull` for example.
Stream is a struct holding the Stream api
Unsafe is the structure holding the unsafe version of the API.
The difference between unsafe api and regular api is that the regular API
copies the buffer passed to Unmarshal functions to a new internal buffer.
Making it safer because internally GoJay uses unsafe.Pointer to transform slice of bytes into a string.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.