Documentation ¶
Index ¶
- func ReadBigInt(inputSource *bytes.Buffer) (value.BigInt, error)
- func ReadBigUInt(inputSource *bytes.Buffer) (value.BigInt, error)
- func ReadByteVector(inputSource *bytes.Buffer) (value.ByteVector, error)
- func ReadInt32(inputSource *bytes.Buffer) (value.Int32Value, error)
- func ReadInt64(inputSource *bytes.Buffer) (value.Int64Value, error)
- func ReadOptionalBigInt(inputSource *bytes.Buffer) (value.Value, error)
- func ReadOptionalByteVector(inputSource *bytes.Buffer) (value.Value, error)
- func ReadOptionalInt32(inputSource *bytes.Buffer) (value.Value, error)
- func ReadOptionalInt64(inputSource *bytes.Buffer) (value.Value, error)
- func ReadOptionalString(inputSource *bytes.Buffer) (value.Value, error)
- func ReadOptionalUInt32(inputSource *bytes.Buffer) (value.Value, error)
- func ReadOptionalUInt64(inputSource *bytes.Buffer) (value.Value, error)
- func ReadString(inputSource *bytes.Buffer) (value.StringValue, error)
- func ReadUInt32(inputSource *bytes.Buffer) (value.UInt32Value, error)
- func ReadUInt64(inputSource *bytes.Buffer) (value.UInt64Value, error)
- func ReadValue(inputSource *bytes.Buffer) ([]byte, error)
- type AsciiStringDecoder
- type AsciiStringDeltaDecoder
- type BitIntDecoder
- type ByteVectorDecoder
- type ByteVectorDeltaDecoder
- type Decoder
- type Int32Decoder
- type Int64Decoder
- type UInt32Decoder
- type UInt64Decoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadBigInt ¶
ReadBigInt reads the next FAST encoded value off the inputSource, treating it as an int64 value. However, this value may overflow an int64 by 1 byte (for delta encoding) and therefore we can return a value.BigInt if this happens. The least significant byte is in the overflow value. If the next value would till overflow this structure an err is returned.
func ReadBigUInt ¶
ReadBigUInt reads the next FAST encoded value off the inputSource, treating it as an uint64 value. However, this value may overflow an uint64 by 1 byte (for delta encoding) and therefore we can return a value.BigInt if this happens. The least significant byte is in the overflow value. If the next value would till overflow this structure an err is returned.
func ReadByteVector ¶
func ReadByteVector(inputSource *bytes.Buffer) (value.ByteVector, error)
ReadByteVector reads a uint32 length off the buffer which represents the length of the vector to then read. The vector read is not stop bit encoded. i.e. 10000010 00000001 00000010 would become (length 2) -> [1, 2]
func ReadInt32 ¶
func ReadInt32(inputSource *bytes.Buffer) (value.Int32Value, error)
ReadInt32 reads the next FAST encoded value off the inputSource, treating it as an int32 value (2's compliment encoded). If the next value would overflow an int32 an err is returned. i.e. 11111111 01001110 would become 11111111001110 -> 11001110 -> -50
func ReadInt64 ¶
func ReadInt64(inputSource *bytes.Buffer) (value.Int64Value, error)
ReadInt64 reads the next FAST encoded value off the inputSource, treating it as an int64 value (2's compliment encoded). If the next value would overflow an int64 an err is returned. i.e. 11111111 01001110 would become 11111111001110 -> 11001110 -> -50
func ReadOptionalBigInt ¶
ReadOptionalBigInt reads a value.BigInt off the input buffer. If the value returned is 0, this is marked as nil, and nil is returned. Due to needing to use 0 as a nil value for optionals, the value returned by this is: value - 1 for positive numbers only.
func ReadOptionalByteVector ¶
ReadOptionalByteVector treats the uint32 length preamble as an optional uint32, reading 0 as a null marker. The byte vector itself is read as long as the length is not null. i.e. 10000010 00000001 would become (length 1) -> [1] i.e. 10000000 would become 0, and be marked as null
func ReadOptionalInt32 ¶
ReadOptionalInt32 reads an int32 off the buffer. If the value returned is 0, this is marked as nil, and nil is returned. Due to needing to use 0 as a nil value for optionals, the value returned by this is: value - 1 for positive numbers only. i.e. 10000000 would become nil, 10000001 would become 0
func ReadOptionalInt64 ¶
ReadOptionalInt64 reads an int64 off the buffer. If the value returned is 0, this is marked as nil, and nil is returned. Due to needing to use 0 as a nil value for optionals, the value returned by this is: value - 1 for positive numbers only. i.e. 10000000 would become nil, 10000001 would become 0
func ReadOptionalString ¶
ReadOptionalString reads an ASCII encoded string off the buffer. If the first value is 10000000, this is seen as null. If the first values are 00000000 10000000 this is seen as an empty string.
func ReadOptionalUInt32 ¶
ReadOptionalUInt32 reads a uint32 off the buffer. If the value returned is 0, this is marked as nil, and nil is returned. Due to needing to use 0 as a nil value for optionals, the value returned by this is: value - 1. i.e. 10000000 would become nil, 10000001 would become 0
func ReadOptionalUInt64 ¶
ReadOptionalUInt64 reads a uint64 off the buffer. If the value returned is 0, this is marked as nil, and nil is returned. Due to needing to use 0 as a nil value for optionals, the value returned by this is: value - 1. i.e. 10000000 would become nil, 10000001 would become 0
func ReadString ¶
func ReadString(inputSource *bytes.Buffer) (value.StringValue, error)
ReadString reads an ASCII encoded string off the buffer. This can be done as ASCII is a subset of UTF-8 which is what GO uses to represent strings.
func ReadUInt32 ¶
func ReadUInt32(inputSource *bytes.Buffer) (value.UInt32Value, error)
ReadUInt32 reads the next FAST encoded value off the inputSource, treating it as a uint32 value. If the next value would overflow a uint32 an err is returned. i.e. 00010010 10001000 would become 100100001000
func ReadUInt64 ¶
func ReadUInt64(inputSource *bytes.Buffer) (value.UInt64Value, error)
ReadUInt64 reads the next FAST encoded value off the inputSource, treating it as a uint64 value. If the next value would overflow a uint64 an err is returned. i.e. 00010010 10001000 would become 100100001000
Types ¶
type AsciiStringDecoder ¶
type AsciiStringDecoder struct { }
AsciiStringDecoder performs a read/optional read of a FAST encoded string
func (AsciiStringDecoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded optional string
type AsciiStringDeltaDecoder ¶
type AsciiStringDeltaDecoder struct { }
AsciiStringDeltaDecoder performs a read/optional read of a FAST encoded string delta
func (AsciiStringDeltaDecoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded string delta
type BitIntDecoder ¶
type BitIntDecoder struct { }
BitIntDecoder performs a read/optional read of a FAST encoded int64 with allowed overflow of a single byte
func (BitIntDecoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded optional int64 with allowed overflow
type ByteVectorDecoder ¶
type ByteVectorDecoder struct { }
ByteVectorDecoder performs a read/optional read of a FAST encoded byte vector
func (ByteVectorDecoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded byte vector
type ByteVectorDeltaDecoder ¶
type ByteVectorDeltaDecoder struct { }
ByteVectorDeltaDecoder performs a read/optional read of a FAST encoded byte vector delta
func (ByteVectorDeltaDecoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded byte vector delta
type Decoder ¶
type Decoder interface { ReadValue(inputSource *bytes.Buffer) (value.Value, error) ReadOptionalValue(inputSource *bytes.Buffer) (value.Value, error) }
Decoder is used to couple the reading of required and optional values of the same type
type Int32Decoder ¶
type Int32Decoder struct { }
Int32Decoder performs a read/optional read of a FAST encoded int32
func (Int32Decoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded optional int32
type Int64Decoder ¶
type Int64Decoder struct { }
Int64Decoder performs a read/optional read of a FAST encoded int64
func (Int64Decoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded optional int64
type UInt32Decoder ¶
type UInt32Decoder struct { }
UInt32Decoder performs a read/optional read of a FAST encoded uint32
func (UInt32Decoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded optional uint32
type UInt64Decoder ¶
type UInt64Decoder struct { }
UInt64Decoder performs a read/optional read of a FAST encoded uint64
func (UInt64Decoder) ReadOptionalValue ¶
ReadOptionalValue fast encoded optional uint64