encoder

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToBytes

func StringToBytes(str string) []byte

Types

type Encoder

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

An Encoder writes JSON values to an output stream.

func (*Encoder) AddFloat

func (enc *Encoder) AddFloat(v float64)

AddFloat adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddFloat32

func (enc *Encoder) AddFloat32(v float32)

AddFloat32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddFloat32Key

func (enc *Encoder) AddFloat32Key(key string, v float32)

AddFloat32Key adds a float32 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddFloat32KeyNullEmpty

func (enc *Encoder) AddFloat32KeyNullEmpty(key string, v float32)

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

func (*Encoder) AddFloat32KeyOmitEmpty

func (enc *Encoder) AddFloat32KeyOmitEmpty(key string, v float32)

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

func (*Encoder) AddFloat32NullEmpty

func (enc *Encoder) AddFloat32NullEmpty(v float32)

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).

func (*Encoder) AddFloat32OmitEmpty

func (enc *Encoder) AddFloat32OmitEmpty(v float32)

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).

func (*Encoder) AddFloat64

func (enc *Encoder) AddFloat64(v float64)

AddFloat64 adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddFloat64Key

func (enc *Encoder) AddFloat64Key(key string, v float64)

AddFloat64Key adds a float64 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddFloat64KeyOmitEmpty

func (enc *Encoder) AddFloat64KeyOmitEmpty(key string, v float64)

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

func (*Encoder) AddFloat64OmitEmpty

func (enc *Encoder) AddFloat64OmitEmpty(v float64)

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).

func (*Encoder) AddFloatKey

func (enc *Encoder) AddFloatKey(key string, v float64)

AddFloatKey adds a float64 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddFloatKeyNullEmpty

func (enc *Encoder) AddFloatKeyNullEmpty(key string, v float64)

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

func (*Encoder) AddFloatKeyOmitEmpty

func (enc *Encoder) AddFloatKeyOmitEmpty(key string, v float64)

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

func (*Encoder) AddFloatNullEmpty

func (enc *Encoder) AddFloatNullEmpty(v float64)

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).

func (*Encoder) AddFloatOmitEmpty

func (enc *Encoder) AddFloatOmitEmpty(v float64)

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).

func (*Encoder) AddInt

func (enc *Encoder) AddInt(v int)

AddInt adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddInt16

func (enc *Encoder) AddInt16(v int16)

AddInt16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddInt16Key

func (enc *Encoder) AddInt16Key(key string, v int16)

AddInt16Key adds an int16 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddInt16KeyNullEmpty

func (enc *Encoder) AddInt16KeyNullEmpty(key string, v int16)

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.

func (*Encoder) AddInt16KeyOmitEmpty

func (enc *Encoder) AddInt16KeyOmitEmpty(key string, v int16)

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.

func (*Encoder) AddInt16OmitEmpty

func (enc *Encoder) AddInt16OmitEmpty(v int16)

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).

func (*Encoder) AddInt32

func (enc *Encoder) AddInt32(v int32)

AddInt32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddInt32Key

func (enc *Encoder) AddInt32Key(key string, v int32)

AddInt32Key adds an int32 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddInt32KeyOmitEmpty

func (enc *Encoder) AddInt32KeyOmitEmpty(key string, v int32)

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.

func (*Encoder) AddInt32NullEmpty

func (enc *Encoder) AddInt32NullEmpty(v int32)

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).

func (*Encoder) AddInt32OmitEmpty

func (enc *Encoder) AddInt32OmitEmpty(v int32)

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).

func (*Encoder) AddInt64

func (enc *Encoder) AddInt64(v int64)

AddInt64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddInt64Key

func (enc *Encoder) AddInt64Key(key string, v int64)

AddInt64Key adds an int64 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddInt64KeyNullEmpty

func (enc *Encoder) AddInt64KeyNullEmpty(key string, v int64)

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.

func (*Encoder) AddInt64KeyOmitEmpty

func (enc *Encoder) AddInt64KeyOmitEmpty(key string, v int64)

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.

func (*Encoder) AddInt64NullEmpty

func (enc *Encoder) AddInt64NullEmpty(v int64)

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).

func (*Encoder) AddInt64OmitEmpty

func (enc *Encoder) AddInt64OmitEmpty(v int64)

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).

func (*Encoder) AddInt8

func (enc *Encoder) AddInt8(v int8)

AddInt8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddInt8Key

func (enc *Encoder) AddInt8Key(key string, v int8)

AddInt8Key adds an int8 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddInt8KeyNullEmpty

func (enc *Encoder) AddInt8KeyNullEmpty(key string, v int8)

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.

func (*Encoder) AddInt8KeyOmitEmpty

func (enc *Encoder) AddInt8KeyOmitEmpty(key string, v int8)

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.

func (*Encoder) AddInt8NullEmpty

func (enc *Encoder) AddInt8NullEmpty(v int8)

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).

func (*Encoder) AddInt8OmitEmpty

func (enc *Encoder) AddInt8OmitEmpty(v int8)

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).

func (*Encoder) AddIntKey

func (enc *Encoder) AddIntKey(key string, v int)

AddIntKey adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddIntKeyNullEmpty

func (enc *Encoder) AddIntKeyNullEmpty(key string, v int)

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.

func (*Encoder) AddIntKeyOmitEmpty

func (enc *Encoder) AddIntKeyOmitEmpty(key string, v int)

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.

func (*Encoder) AddIntNullEmpty

func (enc *Encoder) AddIntNullEmpty(v int)

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).

func (*Encoder) AddIntOmitEmpty

func (enc *Encoder) AddIntOmitEmpty(v int)

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).

func (*Encoder) AddUint16

func (enc *Encoder) AddUint16(v uint16)

AddUint16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddUint16Key

func (enc *Encoder) AddUint16Key(key string, v uint16)

AddUint16Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddUint16KeyNullEmpty

func (enc *Encoder) AddUint16KeyNullEmpty(key string, v uint16)

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.

func (*Encoder) AddUint16KeyOmitEmpty

func (enc *Encoder) AddUint16KeyOmitEmpty(key string, v uint16)

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.

func (*Encoder) AddUint16NullEmpty

func (enc *Encoder) AddUint16NullEmpty(v uint16)

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).

func (*Encoder) AddUint16OmitEmpty

func (enc *Encoder) AddUint16OmitEmpty(v uint16)

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).

func (*Encoder) AddUint32

func (enc *Encoder) AddUint32(v uint32)

AddUint32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddUint32Key

func (enc *Encoder) AddUint32Key(key string, v uint32)

AddUint32Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddUint32KeyNullEmpty

func (enc *Encoder) AddUint32KeyNullEmpty(key string, v uint32)

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.

func (*Encoder) AddUint32KeyOmitEmpty

func (enc *Encoder) AddUint32KeyOmitEmpty(key string, v uint32)

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.

func (*Encoder) AddUint32NullEmpty

func (enc *Encoder) AddUint32NullEmpty(v uint32)

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).

func (*Encoder) AddUint32OmitEmpty

func (enc *Encoder) AddUint32OmitEmpty(v uint32)

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).

func (*Encoder) AddUint64

func (enc *Encoder) AddUint64(v uint64)

AddUint64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddUint64Key

func (enc *Encoder) AddUint64Key(key string, v uint64)

AddUint64Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddUint64KeyNullEmpty

func (enc *Encoder) AddUint64KeyNullEmpty(key string, v uint64)

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.

func (*Encoder) AddUint64KeyOmitEmpty

func (enc *Encoder) AddUint64KeyOmitEmpty(key string, v uint64)

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.

func (*Encoder) AddUint64NullEmpty

func (enc *Encoder) AddUint64NullEmpty(v uint64)

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).

func (*Encoder) AddUint64OmitEmpty

func (enc *Encoder) AddUint64OmitEmpty(v uint64)

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).

func (*Encoder) AddUint8

func (enc *Encoder) AddUint8(v uint8)

AddUint8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) AddUint8Key

func (enc *Encoder) AddUint8Key(key string, v uint8)

AddUint8Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) AddUint8KeyNullEmpty

func (enc *Encoder) AddUint8KeyNullEmpty(key string, v uint8)

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.

func (*Encoder) AddUint8KeyOmitEmpty

func (enc *Encoder) AddUint8KeyOmitEmpty(key string, v uint8)

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.

func (*Encoder) AddUint8NullEmpty

func (enc *Encoder) AddUint8NullEmpty(v uint8)

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).

func (*Encoder) AddUint8OmitEmpty

func (enc *Encoder) AddUint8OmitEmpty(v uint8)

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).

func (*Encoder) AppendByte

func (enc *Encoder) AppendByte(b byte)

AppendByte allows a modular usage by appending a single byte manually to the current state of the buffer.

func (*Encoder) AppendBytes

func (enc *Encoder) AppendBytes(b []byte)

AppendBytes allows a modular usage by appending bytes manually to the current state of the buffer.

func (*Encoder) Buf

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

Buf returns the Encoder's buffer.

func (*Encoder) Encode

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

Encode encodes a value to JSON.

If Encode cannot find a way to encode the type to JSON it will return an InvalidMarshalError.

func (*Encoder) EncodeFloat

func (enc *Encoder) EncodeFloat(n float64) error

EncodeFloat encodes a float64 to JSON

func (*Encoder) EncodeFloat32

func (enc *Encoder) EncodeFloat32(n float32) error

EncodeFloat32 encodes a float32 to JSON

func (*Encoder) EncodeInt

func (enc *Encoder) EncodeInt(n int) error

EncodeInt encodes an int to JSON

func (*Encoder) EncodeInt64

func (enc *Encoder) EncodeInt64(n int64) error

EncodeInt64 encodes an int64 to JSON

func (*Encoder) EncodeUint64

func (enc *Encoder) EncodeUint64(n uint64) error

EncodeUint64 encodes an int64 to JSON

func (*Encoder) Float

func (enc *Encoder) Float(v float64)

Float adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Float32

func (enc *Encoder) Float32(v float32)

Float32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Float32Key

func (enc *Encoder) Float32Key(key string, v float32)

Float32Key adds a float32 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Float32KeyNullEmpty

func (enc *Encoder) Float32KeyNullEmpty(key string, v float32)

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

func (*Encoder) Float32KeyOmitEmpty

func (enc *Encoder) Float32KeyOmitEmpty(key string, v float32)

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

func (*Encoder) Float32NullEmpty

func (enc *Encoder) Float32NullEmpty(v float32)

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).

func (*Encoder) Float32OmitEmpty

func (enc *Encoder) Float32OmitEmpty(v float32)

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).

func (*Encoder) Float64

func (enc *Encoder) Float64(v float64)

Float64 adds a float64 to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Float64Key

func (enc *Encoder) Float64Key(key string, value float64)

Float64Key adds a float64 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Float64KeyNullEmpty

func (enc *Encoder) Float64KeyNullEmpty(key string, v float64)

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).

func (*Encoder) Float64KeyOmitEmpty

func (enc *Encoder) Float64KeyOmitEmpty(key string, v float64)

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

func (*Encoder) Float64NullEmpty

func (enc *Encoder) Float64NullEmpty(v float64)

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).

func (*Encoder) Float64OmitEmpty

func (enc *Encoder) Float64OmitEmpty(v float64)

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).

func (*Encoder) FloatKey

func (enc *Encoder) FloatKey(key string, v float64)

FloatKey adds a float64 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) FloatKeyNullEmpty

func (enc *Encoder) FloatKeyNullEmpty(key string, v float64)

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

func (*Encoder) FloatKeyOmitEmpty

func (enc *Encoder) FloatKeyOmitEmpty(key string, v float64)

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

func (*Encoder) FloatNullEmpty

func (enc *Encoder) FloatNullEmpty(v float64)

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).

func (*Encoder) FloatOmitEmpty

func (enc *Encoder) FloatOmitEmpty(v float64)

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).

func (*Encoder) Int

func (enc *Encoder) Int(v int)

Int adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Int16

func (enc *Encoder) Int16(v int16)

Int16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Int16Key

func (enc *Encoder) Int16Key(key string, v int16)

Int16Key adds an int16 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Int16KeyNullEmpty

func (enc *Encoder) Int16KeyNullEmpty(key string, v int16)

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.

func (*Encoder) Int16KeyOmitEmpty

func (enc *Encoder) Int16KeyOmitEmpty(key string, v int16)

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.

func (*Encoder) Int16NullEmpty

func (enc *Encoder) Int16NullEmpty(v int16)

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).

func (*Encoder) Int16OmitEmpty

func (enc *Encoder) Int16OmitEmpty(v int16)

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).

func (*Encoder) Int32

func (enc *Encoder) Int32(v int32)

Int32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Int32Key

func (enc *Encoder) Int32Key(key string, v int32)

Int32Key adds an int32 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Int32KeyNullEmpty

func (enc *Encoder) Int32KeyNullEmpty(key string, v int32)

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.

func (*Encoder) Int32KeyOmitEmpty

func (enc *Encoder) Int32KeyOmitEmpty(key string, v int32)

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.

func (*Encoder) Int32NullEmpty

func (enc *Encoder) Int32NullEmpty(v int32)

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).

func (*Encoder) Int32OmitEmpty

func (enc *Encoder) Int32OmitEmpty(v int32)

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).

func (*Encoder) Int64

func (enc *Encoder) Int64(v int64)

Int64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Int64Key

func (enc *Encoder) Int64Key(key string, v int64)

Int64Key adds an int64 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Int64KeyNullEmpty

func (enc *Encoder) Int64KeyNullEmpty(key string, v int64)

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.

func (*Encoder) Int64KeyOmitEmpty

func (enc *Encoder) Int64KeyOmitEmpty(key string, v int64)

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.

func (*Encoder) Int64NullEmpty

func (enc *Encoder) Int64NullEmpty(v int64)

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).

func (*Encoder) Int64OmitEmpty

func (enc *Encoder) Int64OmitEmpty(v int64)

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).

func (*Encoder) Int8

func (enc *Encoder) Int8(v int8)

Int8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Int8Key

func (enc *Encoder) Int8Key(key string, v int8)

Int8Key adds an int8 to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Int8KeyNullEmpty

func (enc *Encoder) Int8KeyNullEmpty(key string, v int8)

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.

func (*Encoder) Int8KeyOmitEmpty

func (enc *Encoder) Int8KeyOmitEmpty(key string, v int8)

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.

func (*Encoder) Int8NullEmpty

func (enc *Encoder) Int8NullEmpty(v int8)

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).

func (*Encoder) Int8OmitEmpty

func (enc *Encoder) Int8OmitEmpty(v int8)

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).

func (*Encoder) IntKey

func (enc *Encoder) IntKey(key string, v int)

IntKey adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) IntKeyNullEmpty

func (enc *Encoder) IntKeyNullEmpty(key string, v int)

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.

func (*Encoder) IntKeyOmitEmpty

func (enc *Encoder) IntKeyOmitEmpty(key string, v int)

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.

func (*Encoder) IntNullEmpty

func (enc *Encoder) IntNullEmpty(v int)

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).

func (*Encoder) IntOmitEmpty

func (enc *Encoder) IntOmitEmpty(v int)

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).

func (*Encoder) Uint16

func (enc *Encoder) Uint16(v uint16)

Uint16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Uint16Key

func (enc *Encoder) Uint16Key(key string, v uint16)

Uint16Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Uint16KeyNullEmpty

func (enc *Encoder) Uint16KeyNullEmpty(key string, v uint16)

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.

func (*Encoder) Uint16KeyOmitEmpty

func (enc *Encoder) Uint16KeyOmitEmpty(key string, v uint16)

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.

func (*Encoder) Uint16NullEmpty

func (enc *Encoder) Uint16NullEmpty(v uint16)

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).

func (*Encoder) Uint16OmitEmpty

func (enc *Encoder) Uint16OmitEmpty(v uint16)

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).

func (*Encoder) Uint32

func (enc *Encoder) Uint32(v uint32)

Uint32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Uint32Key

func (enc *Encoder) Uint32Key(key string, v uint32)

Uint32Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Uint32KeyNullEmpty

func (enc *Encoder) Uint32KeyNullEmpty(key string, v uint32)

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.

func (*Encoder) Uint32KeyOmitEmpty

func (enc *Encoder) Uint32KeyOmitEmpty(key string, v uint32)

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.

func (*Encoder) Uint32NullEmpty

func (enc *Encoder) Uint32NullEmpty(v uint32)

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).

func (*Encoder) Uint32OmitEmpty

func (enc *Encoder) Uint32OmitEmpty(v uint32)

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).

func (*Encoder) Uint64

func (enc *Encoder) Uint64(v uint64)

Uint64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Uint64Key

func (enc *Encoder) Uint64Key(key string, v uint64)

Uint64Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Uint64KeyNullEmpty

func (enc *Encoder) Uint64KeyNullEmpty(key string, v uint64)

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.

func (*Encoder) Uint64KeyOmitEmpty

func (enc *Encoder) Uint64KeyOmitEmpty(key string, v uint64)

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.

func (*Encoder) Uint64NullEmpty

func (enc *Encoder) Uint64NullEmpty(v uint64)

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).

func (*Encoder) Uint64OmitEmpty

func (enc *Encoder) Uint64OmitEmpty(v uint64)

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).

func (*Encoder) Uint8

func (enc *Encoder) Uint8(v uint8)

Uint8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)

func (*Encoder) Uint8Key

func (enc *Encoder) Uint8Key(key string, v uint8)

Uint8Key adds an int to be encoded, must be used inside an object as it will encode a key

func (*Encoder) Uint8KeyNullEmpty

func (enc *Encoder) Uint8KeyNullEmpty(key string, v uint8)

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.

func (*Encoder) Uint8KeyOmitEmpty

func (enc *Encoder) Uint8KeyOmitEmpty(key string, v uint8)

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.

func (*Encoder) Uint8NullEmpty

func (enc *Encoder) Uint8NullEmpty(v uint8)

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).

func (*Encoder) Uint8OmitEmpty

func (enc *Encoder) Uint8OmitEmpty(v uint8)

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).

func (*Encoder) Write

func (enc *Encoder) Write() (int, error)

Write writes to the io.Writer and resets the buffer.

type InvalidMarshalError

type InvalidMarshalError string

func (InvalidMarshalError) Error

func (err InvalidMarshalError) Error() string

type InvalidUsagePooledEncoderError

type InvalidUsagePooledEncoderError string

InvalidUsagePooledEncoderError is a type representing an error returned when decoding is called on a still pooled Encoder

func (InvalidUsagePooledEncoderError) Error

Jump to

Keyboard shortcuts

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