fbe

package
v0.0.0-...-67625fc Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxInt = int(^uint(0) >> 1)

Maximal signed integer value

View Source
const MaxUint = ^uint(0)

Maximal unsigned integer value

View Source
const MinInt = -MaxInt - 1

Minimal signed integer value

View Source
const MinUint = 0

Minimal unsigned integer value

View Source
const Version = "1.14.5.0"

Package version

Variables

View Source
var Json = jsoniter.ConfigCompatibleWithStandardLibrary

Json engine

Functions

func OptionalBool

func OptionalBool(value bool) *bool

Create an optional bool

func OptionalByte

func OptionalByte(value byte) *byte

Create an optional byte

func OptionalBytes

func OptionalBytes(value []byte) *[]byte

Create an optional bytes

func OptionalFloat32

func OptionalFloat32(value float32) *float32

Create an optional float32

func OptionalFloat64

func OptionalFloat64(value float64) *float64

Create an optional float64

func OptionalInt16

func OptionalInt16(value int16) *int16

Create an optional int16

func OptionalInt32

func OptionalInt32(value int32) *int32

Create an optional int32

func OptionalInt64

func OptionalInt64(value int64) *int64

Create an optional int64

func OptionalInt8

func OptionalInt8(value int8) *int8

Create an optional int8

func OptionalRune

func OptionalRune(value rune) *rune

Create an optional rune

func OptionalString

func OptionalString(value string) *string

Create an optional string

func OptionalUInt16

func OptionalUInt16(value uint16) *uint16

Create an optional uint16

func OptionalUInt32

func OptionalUInt32(value uint32) *uint32

Create an optional uint32

func OptionalUInt64

func OptionalUInt64(value uint64) *uint64

Create an optional uint64

func OptionalUInt8

func OptionalUInt8(value uint8) *uint8

Create an optional uint8

func ReadBool

func ReadBool(buffer []byte, offset int) bool

Read bool from the buffer

func ReadByte

func ReadByte(buffer []byte, offset int) byte

Read byte from the buffer

func ReadBytes

func ReadBytes(buffer []byte, offset int, size int) []byte

Read bytes from the buffer

func ReadChar

func ReadChar(buffer []byte, offset int) rune

Read single byte character from the buffer

func ReadDouble

func ReadDouble(buffer []byte, offset int) float64

Read double from the buffer

func ReadFloat

func ReadFloat(buffer []byte, offset int) float32

Read float from the buffer

func ReadInt16

func ReadInt16(buffer []byte, offset int) int16

Read signed 16-bits integer from the buffer

func ReadInt32

func ReadInt32(buffer []byte, offset int) int32

Read signed 32-bits integer from the buffer

func ReadInt64

func ReadInt64(buffer []byte, offset int) int64

Read signed 64-bits integer from the buffer

func ReadInt8

func ReadInt8(buffer []byte, offset int) int8

Read signed 8-bits integer from the buffer

func ReadString

func ReadString(buffer []byte, offset int, size int) string

Read string from the buffer

func ReadUInt16

func ReadUInt16(buffer []byte, offset int) uint16

Read unsigned 16-bits integer from the buffer

func ReadUInt32

func ReadUInt32(buffer []byte, offset int) uint32

Read unsigned 32-bits integer from the buffer

func ReadUInt64

func ReadUInt64(buffer []byte, offset int) uint64

Read unsigned 64-bits integer from the buffer

func ReadUInt8

func ReadUInt8(buffer []byte, offset int) uint8

Read unsigned 8-bits integer from the buffer

func ReadWChar

func ReadWChar(buffer []byte, offset int) rune

Read four bytes character from the buffer

func WriteBool

func WriteBool(buffer []byte, offset int, value bool)

Write bool into the buffer

func WriteByte

func WriteByte(buffer []byte, offset int, value byte)

Write byte into the buffer

func WriteBytes

func WriteBytes(buffer []byte, offset int, value []byte)

Write bytes into the buffer

func WriteChar

func WriteChar(buffer []byte, offset int, value rune)

Write single byte character into the buffer

func WriteCount

func WriteCount(buffer []byte, offset int, value byte, valueCount int)

Write count of single byte into the buffer

func WriteDouble

func WriteDouble(buffer []byte, offset int, value float64)

Write double into the buffer

func WriteFloat

func WriteFloat(buffer []byte, offset int, value float32)

Write float into the buffer

func WriteInt16

func WriteInt16(buffer []byte, offset int, value int16)

Write signed 16-bits integer into the buffer

func WriteInt32

func WriteInt32(buffer []byte, offset int, value int32)

Write signed 32-bits integer into the buffer

func WriteInt64

func WriteInt64(buffer []byte, offset int, value int64)

Write signed 64-bits integer into the buffer

func WriteInt8

func WriteInt8(buffer []byte, offset int, value int8)

Write signed 8-bits integer into the buffer

func WriteSlice

func WriteSlice(buffer []byte, offset int, value []byte, valueOffset int, valueSize int)

Write slice into the buffer

func WriteString

func WriteString(buffer []byte, offset int, value string)

Write string into the buffer

func WriteTimestamp

func WriteTimestamp(buffer []byte, offset int, value Timestamp)

Write timestamp into the buffer

func WriteUInt16

func WriteUInt16(buffer []byte, offset int, value uint16)

Write unsigned 16-bits integer into the buffer

func WriteUInt32

func WriteUInt32(buffer []byte, offset int, value uint32)

Write unsigned 32-bits integer into the buffer

func WriteUInt64

func WriteUInt64(buffer []byte, offset int, value uint64)

Write unsigned 64-bits integer into the buffer

func WriteUInt8

func WriteUInt8(buffer []byte, offset int, value uint8)

Write unsigned 8-bits integer into the buffer

func WriteUUID

func WriteUUID(buffer []byte, offset int, value UUID)

Write UUID into the buffer

func WriteWChar

func WriteWChar(buffer []byte, offset int, value rune)

Write four bytes character into the buffer

Types

type Buffer

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

Fast Binary Encoding buffer based on dynamic byte array

func NewAttached

func NewAttached(buffer []byte) *Buffer

Create a buffer with attached bytes memory buffer

func NewAttachedBuffer

func NewAttachedBuffer(buffer *Buffer) *Buffer

Create a buffer with another attached buffer

func NewAttachedBytes

func NewAttachedBytes(buffer []byte, offset int, size int) *Buffer

Create a buffer with attached bytes memory buffer with offset and size

func NewCapacityBuffer

func NewCapacityBuffer(capacity int) *Buffer

Create an empty buffer with the given capacity

func NewEmptyBuffer

func NewEmptyBuffer() *Buffer

Create an empty buffer

func (*Buffer) Allocate

func (b *Buffer) Allocate(size int) int

Allocate memory in the current write buffer and return offset to the allocated memory block

func (*Buffer) Attach

func (b *Buffer) Attach(buffer []byte)

Attach the given bytes memory buffer

func (*Buffer) AttachBuffer

func (b *Buffer) AttachBuffer(buffer *Buffer)

Attach another buffer

func (*Buffer) AttachBytes

func (b *Buffer) AttachBytes(buffer []byte, offset int, size int)

Attach the given bytes memory buffer with offset and size

func (*Buffer) AttachCapacity

func (b *Buffer) AttachCapacity(capacity int)

Attach an empty memory buffer with the given capacity

func (*Buffer) AttachNew

func (b *Buffer) AttachNew()

Attach an empty memory buffer

func (*Buffer) Capacity

func (b *Buffer) Capacity() int

Get bytes memory buffer capacity

func (*Buffer) Data

func (b *Buffer) Data() []byte

Get bytes memory buffer

func (*Buffer) Empty

func (b *Buffer) Empty() bool

Is the buffer empty?

func (*Buffer) Offset

func (b *Buffer) Offset() int

Get bytes memory buffer offset

func (*Buffer) Remove

func (b *Buffer) Remove(offset int, size int)

Remove some memory of the given size from the current write buffer

func (*Buffer) Reserve

func (b *Buffer) Reserve(capacity int)

Reserve memory of the given capacity in the current write bufferb

func (*Buffer) Reset

func (b *Buffer) Reset()

Reset the current write buffer and its offset

func (*Buffer) Resize

func (b *Buffer) Resize(size int)

Resize the current write buffer

func (*Buffer) Shift

func (b *Buffer) Shift(offset int)

Shift the current write buffer offset

func (*Buffer) Size

func (b *Buffer) Size() int

Get bytes memory buffer size

func (*Buffer) Unshift

func (b *Buffer) Unshift(offset int)

Unshift the current write buffer offset

type Decimal

type Decimal struct {
	decimal.Decimal
}

Decimal struct

func DecimalFromFloat

func DecimalFromFloat(value float64) Decimal

Create a new decimal from the given float value

func DecimalFromString

func DecimalFromString(value string) Decimal

Create a new decimal from the given string

func DecimalZero

func DecimalZero() Decimal

Create zero decimal

func OptionalDecimal

func OptionalDecimal(value Decimal) *Decimal

Create an optional decimal

type FieldModelBool

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

Fast Binary Encoding Bool field model

func NewFieldModelBool

func NewFieldModelBool(buffer *Buffer, offset int) *FieldModelBool

Create a new Bool field model

func (*FieldModelBool) FBEExtra

func (fm *FieldModelBool) FBEExtra() int

Get the field extra size

func (*FieldModelBool) FBEOffset

func (fm *FieldModelBool) FBEOffset() int

Get the field offset

func (*FieldModelBool) FBEShift

func (fm *FieldModelBool) FBEShift(size int)

Shift the current field offset

func (*FieldModelBool) FBESize

func (fm *FieldModelBool) FBESize() int

Get the field size

func (*FieldModelBool) FBEUnshift

func (fm *FieldModelBool) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelBool) Get

func (fm *FieldModelBool) Get() (bool, error)

Get the value

func (*FieldModelBool) GetDefault

func (fm *FieldModelBool) GetDefault(defaults bool) (bool, error)

Get the value with provided default value

func (*FieldModelBool) Set

func (fm *FieldModelBool) Set(value bool) error

Set the value

func (*FieldModelBool) SetFBEOffset

func (fm *FieldModelBool) SetFBEOffset(value int)

Set the field offset

func (*FieldModelBool) Verify

func (fm *FieldModelBool) Verify() bool

Check if the value is valid

type FieldModelByte

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

Fast Binary Encoding Byte field model

func NewFieldModelByte

func NewFieldModelByte(buffer *Buffer, offset int) *FieldModelByte

Create a new Byte field model

func (*FieldModelByte) FBEExtra

func (fm *FieldModelByte) FBEExtra() int

Get the field extra size

func (*FieldModelByte) FBEOffset

func (fm *FieldModelByte) FBEOffset() int

Get the field offset

func (*FieldModelByte) FBEShift

func (fm *FieldModelByte) FBEShift(size int)

Shift the current field offset

func (*FieldModelByte) FBESize

func (fm *FieldModelByte) FBESize() int

Get the field size

func (*FieldModelByte) FBEUnshift

func (fm *FieldModelByte) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelByte) Get

func (fm *FieldModelByte) Get() (byte, error)

Get the value

func (*FieldModelByte) GetDefault

func (fm *FieldModelByte) GetDefault(defaults byte) (byte, error)

Get the value with provided default value

func (*FieldModelByte) Set

func (fm *FieldModelByte) Set(value byte) error

Set the value

func (*FieldModelByte) SetFBEOffset

func (fm *FieldModelByte) SetFBEOffset(value int)

Set the field offset

func (*FieldModelByte) Verify

func (fm *FieldModelByte) Verify() bool

Check if the value is valid

type FieldModelBytes

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

Fast Binary Encoding bytes field model

func NewFieldModelBytes

func NewFieldModelBytes(buffer *Buffer, offset int) *FieldModelBytes

Create a new bytes field model

func (*FieldModelBytes) FBEExtra

func (fm *FieldModelBytes) FBEExtra() int

Get the field extra size

func (*FieldModelBytes) FBEOffset

func (fm *FieldModelBytes) FBEOffset() int

Get the field offset

func (*FieldModelBytes) FBEShift

func (fm *FieldModelBytes) FBEShift(size int)

Shift the current field offset

func (*FieldModelBytes) FBESize

func (fm *FieldModelBytes) FBESize() int

Get the field size

func (*FieldModelBytes) FBEUnshift

func (fm *FieldModelBytes) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelBytes) Get

func (fm *FieldModelBytes) Get() ([]byte, error)

Get the bytes value

func (*FieldModelBytes) GetDefault

func (fm *FieldModelBytes) GetDefault(defaults []byte) ([]byte, error)

Get the bytes value with provided default value

func (*FieldModelBytes) Set

func (fm *FieldModelBytes) Set(value []byte) error

Set the bytes value

func (*FieldModelBytes) SetFBEOffset

func (fm *FieldModelBytes) SetFBEOffset(value int)

Set the field offset

func (*FieldModelBytes) Verify

func (fm *FieldModelBytes) Verify() bool

Check if the bytes value is valid

type FieldModelChar

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

Fast Binary Encoding Char field model

func NewFieldModelChar

func NewFieldModelChar(buffer *Buffer, offset int) *FieldModelChar

Create a new Char field model

func (*FieldModelChar) FBEExtra

func (fm *FieldModelChar) FBEExtra() int

Get the field extra size

func (*FieldModelChar) FBEOffset

func (fm *FieldModelChar) FBEOffset() int

Get the field offset

func (*FieldModelChar) FBEShift

func (fm *FieldModelChar) FBEShift(size int)

Shift the current field offset

func (*FieldModelChar) FBESize

func (fm *FieldModelChar) FBESize() int

Get the field size

func (*FieldModelChar) FBEUnshift

func (fm *FieldModelChar) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelChar) Get

func (fm *FieldModelChar) Get() (rune, error)

Get the value

func (*FieldModelChar) GetDefault

func (fm *FieldModelChar) GetDefault(defaults rune) (rune, error)

Get the value with provided default value

func (*FieldModelChar) Set

func (fm *FieldModelChar) Set(value rune) error

Set the value

func (*FieldModelChar) SetFBEOffset

func (fm *FieldModelChar) SetFBEOffset(value int)

Set the field offset

func (*FieldModelChar) Verify

func (fm *FieldModelChar) Verify() bool

Check if the value is valid

type FieldModelDecimal

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

Fast Binary Encoding decimal field model

func NewFieldModelDecimal

func NewFieldModelDecimal(buffer *Buffer, offset int) *FieldModelDecimal

Create a new decimal field model

func (*FieldModelDecimal) FBEExtra

func (fm *FieldModelDecimal) FBEExtra() int

Get the field extra size

func (*FieldModelDecimal) FBEOffset

func (fm *FieldModelDecimal) FBEOffset() int

Get the field offset

func (*FieldModelDecimal) FBEShift

func (fm *FieldModelDecimal) FBEShift(size int)

Shift the current field offset

func (*FieldModelDecimal) FBESize

func (fm *FieldModelDecimal) FBESize() int

Get the field size

func (*FieldModelDecimal) FBEUnshift

func (fm *FieldModelDecimal) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelDecimal) Get

func (fm *FieldModelDecimal) Get() (Decimal, error)

Get the decimal value

func (*FieldModelDecimal) GetDefault

func (fm *FieldModelDecimal) GetDefault(defaults Decimal) (Decimal, error)

Get the decimal value with provided default value

func (*FieldModelDecimal) Set

func (fm *FieldModelDecimal) Set(value Decimal) error

Set the decimal value

func (*FieldModelDecimal) SetFBEOffset

func (fm *FieldModelDecimal) SetFBEOffset(value int)

Set the field offset

func (*FieldModelDecimal) Verify

func (fm *FieldModelDecimal) Verify() bool

Check if the decimal value is valid

type FieldModelDouble

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

Fast Binary Encoding Double field model

func NewFieldModelDouble

func NewFieldModelDouble(buffer *Buffer, offset int) *FieldModelDouble

Create a new Double field model

func (*FieldModelDouble) FBEExtra

func (fm *FieldModelDouble) FBEExtra() int

Get the field extra size

func (*FieldModelDouble) FBEOffset

func (fm *FieldModelDouble) FBEOffset() int

Get the field offset

func (*FieldModelDouble) FBEShift

func (fm *FieldModelDouble) FBEShift(size int)

Shift the current field offset

func (*FieldModelDouble) FBESize

func (fm *FieldModelDouble) FBESize() int

Get the field size

func (*FieldModelDouble) FBEUnshift

func (fm *FieldModelDouble) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelDouble) Get

func (fm *FieldModelDouble) Get() (float64, error)

Get the value

func (*FieldModelDouble) GetDefault

func (fm *FieldModelDouble) GetDefault(defaults float64) (float64, error)

Get the value with provided default value

func (*FieldModelDouble) Set

func (fm *FieldModelDouble) Set(value float64) error

Set the value

func (*FieldModelDouble) SetFBEOffset

func (fm *FieldModelDouble) SetFBEOffset(value int)

Set the field offset

func (*FieldModelDouble) Verify

func (fm *FieldModelDouble) Verify() bool

Check if the value is valid

type FieldModelFloat

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

Fast Binary Encoding Float field model

func NewFieldModelFloat

func NewFieldModelFloat(buffer *Buffer, offset int) *FieldModelFloat

Create a new Float field model

func (*FieldModelFloat) FBEExtra

func (fm *FieldModelFloat) FBEExtra() int

Get the field extra size

func (*FieldModelFloat) FBEOffset

func (fm *FieldModelFloat) FBEOffset() int

Get the field offset

func (*FieldModelFloat) FBEShift

func (fm *FieldModelFloat) FBEShift(size int)

Shift the current field offset

func (*FieldModelFloat) FBESize

func (fm *FieldModelFloat) FBESize() int

Get the field size

func (*FieldModelFloat) FBEUnshift

func (fm *FieldModelFloat) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelFloat) Get

func (fm *FieldModelFloat) Get() (float32, error)

Get the value

func (*FieldModelFloat) GetDefault

func (fm *FieldModelFloat) GetDefault(defaults float32) (float32, error)

Get the value with provided default value

func (*FieldModelFloat) Set

func (fm *FieldModelFloat) Set(value float32) error

Set the value

func (*FieldModelFloat) SetFBEOffset

func (fm *FieldModelFloat) SetFBEOffset(value int)

Set the field offset

func (*FieldModelFloat) Verify

func (fm *FieldModelFloat) Verify() bool

Check if the value is valid

type FieldModelInt16

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

Fast Binary Encoding Int16 field model

func NewFieldModelInt16

func NewFieldModelInt16(buffer *Buffer, offset int) *FieldModelInt16

Create a new Int16 field model

func (*FieldModelInt16) FBEExtra

func (fm *FieldModelInt16) FBEExtra() int

Get the field extra size

func (*FieldModelInt16) FBEOffset

func (fm *FieldModelInt16) FBEOffset() int

Get the field offset

func (*FieldModelInt16) FBEShift

func (fm *FieldModelInt16) FBEShift(size int)

Shift the current field offset

func (*FieldModelInt16) FBESize

func (fm *FieldModelInt16) FBESize() int

Get the field size

func (*FieldModelInt16) FBEUnshift

func (fm *FieldModelInt16) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelInt16) Get

func (fm *FieldModelInt16) Get() (int16, error)

Get the value

func (*FieldModelInt16) GetDefault

func (fm *FieldModelInt16) GetDefault(defaults int16) (int16, error)

Get the value with provided default value

func (*FieldModelInt16) Set

func (fm *FieldModelInt16) Set(value int16) error

Set the value

func (*FieldModelInt16) SetFBEOffset

func (fm *FieldModelInt16) SetFBEOffset(value int)

Set the field offset

func (*FieldModelInt16) Verify

func (fm *FieldModelInt16) Verify() bool

Check if the value is valid

type FieldModelInt32

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

Fast Binary Encoding Int32 field model

func NewFieldModelInt32

func NewFieldModelInt32(buffer *Buffer, offset int) *FieldModelInt32

Create a new Int32 field model

func (*FieldModelInt32) FBEExtra

func (fm *FieldModelInt32) FBEExtra() int

Get the field extra size

func (*FieldModelInt32) FBEOffset

func (fm *FieldModelInt32) FBEOffset() int

Get the field offset

func (*FieldModelInt32) FBEShift

func (fm *FieldModelInt32) FBEShift(size int)

Shift the current field offset

func (*FieldModelInt32) FBESize

func (fm *FieldModelInt32) FBESize() int

Get the field size

func (*FieldModelInt32) FBEUnshift

func (fm *FieldModelInt32) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelInt32) Get

func (fm *FieldModelInt32) Get() (int32, error)

Get the value

func (*FieldModelInt32) GetDefault

func (fm *FieldModelInt32) GetDefault(defaults int32) (int32, error)

Get the value with provided default value

func (*FieldModelInt32) Set

func (fm *FieldModelInt32) Set(value int32) error

Set the value

func (*FieldModelInt32) SetFBEOffset

func (fm *FieldModelInt32) SetFBEOffset(value int)

Set the field offset

func (*FieldModelInt32) Verify

func (fm *FieldModelInt32) Verify() bool

Check if the value is valid

type FieldModelInt64

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

Fast Binary Encoding Int64 field model

func NewFieldModelInt64

func NewFieldModelInt64(buffer *Buffer, offset int) *FieldModelInt64

Create a new Int64 field model

func (*FieldModelInt64) FBEExtra

func (fm *FieldModelInt64) FBEExtra() int

Get the field extra size

func (*FieldModelInt64) FBEOffset

func (fm *FieldModelInt64) FBEOffset() int

Get the field offset

func (*FieldModelInt64) FBEShift

func (fm *FieldModelInt64) FBEShift(size int)

Shift the current field offset

func (*FieldModelInt64) FBESize

func (fm *FieldModelInt64) FBESize() int

Get the field size

func (*FieldModelInt64) FBEUnshift

func (fm *FieldModelInt64) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelInt64) Get

func (fm *FieldModelInt64) Get() (int64, error)

Get the value

func (*FieldModelInt64) GetDefault

func (fm *FieldModelInt64) GetDefault(defaults int64) (int64, error)

Get the value with provided default value

func (*FieldModelInt64) Set

func (fm *FieldModelInt64) Set(value int64) error

Set the value

func (*FieldModelInt64) SetFBEOffset

func (fm *FieldModelInt64) SetFBEOffset(value int)

Set the field offset

func (*FieldModelInt64) Verify

func (fm *FieldModelInt64) Verify() bool

Check if the value is valid

type FieldModelInt8

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

Fast Binary Encoding Int8 field model

func NewFieldModelInt8

func NewFieldModelInt8(buffer *Buffer, offset int) *FieldModelInt8

Create a new Int8 field model

func (*FieldModelInt8) FBEExtra

func (fm *FieldModelInt8) FBEExtra() int

Get the field extra size

func (*FieldModelInt8) FBEOffset

func (fm *FieldModelInt8) FBEOffset() int

Get the field offset

func (*FieldModelInt8) FBEShift

func (fm *FieldModelInt8) FBEShift(size int)

Shift the current field offset

func (*FieldModelInt8) FBESize

func (fm *FieldModelInt8) FBESize() int

Get the field size

func (*FieldModelInt8) FBEUnshift

func (fm *FieldModelInt8) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelInt8) Get

func (fm *FieldModelInt8) Get() (int8, error)

Get the value

func (*FieldModelInt8) GetDefault

func (fm *FieldModelInt8) GetDefault(defaults int8) (int8, error)

Get the value with provided default value

func (*FieldModelInt8) Set

func (fm *FieldModelInt8) Set(value int8) error

Set the value

func (*FieldModelInt8) SetFBEOffset

func (fm *FieldModelInt8) SetFBEOffset(value int)

Set the field offset

func (*FieldModelInt8) Verify

func (fm *FieldModelInt8) Verify() bool

Check if the value is valid

type FieldModelString

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

Fast Binary Encoding string field model

func NewFieldModelString

func NewFieldModelString(buffer *Buffer, offset int) *FieldModelString

Create a new string field model

func (*FieldModelString) FBEExtra

func (fm *FieldModelString) FBEExtra() int

Get the field extra size

func (*FieldModelString) FBEOffset

func (fm *FieldModelString) FBEOffset() int

Get the field offset

func (*FieldModelString) FBEShift

func (fm *FieldModelString) FBEShift(size int)

Shift the current field offset

func (*FieldModelString) FBESize

func (fm *FieldModelString) FBESize() int

Get the field size

func (*FieldModelString) FBEUnshift

func (fm *FieldModelString) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelString) Get

func (fm *FieldModelString) Get() (string, error)

Get the string value

func (*FieldModelString) GetDefault

func (fm *FieldModelString) GetDefault(defaults string) (string, error)

Get the string value with provided default value

func (*FieldModelString) Set

func (fm *FieldModelString) Set(value string) error

Set the string value

func (*FieldModelString) SetFBEOffset

func (fm *FieldModelString) SetFBEOffset(value int)

Set the field offset

func (*FieldModelString) Verify

func (fm *FieldModelString) Verify() bool

Check if the string value is valid

type FieldModelTimestamp

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

Fast Binary Encoding timestamp field model

func NewFieldModelTimestamp

func NewFieldModelTimestamp(buffer *Buffer, offset int) *FieldModelTimestamp

Create a new timestamp field model

func (*FieldModelTimestamp) FBEExtra

func (fm *FieldModelTimestamp) FBEExtra() int

Get the field extra size

func (*FieldModelTimestamp) FBEOffset

func (fm *FieldModelTimestamp) FBEOffset() int

Get the field offset

func (*FieldModelTimestamp) FBEShift

func (fm *FieldModelTimestamp) FBEShift(size int)

Shift the current field offset

func (*FieldModelTimestamp) FBESize

func (fm *FieldModelTimestamp) FBESize() int

Get the field size

func (*FieldModelTimestamp) FBEUnshift

func (fm *FieldModelTimestamp) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelTimestamp) Get

func (fm *FieldModelTimestamp) Get() (Timestamp, error)

Get the timestamp value

func (*FieldModelTimestamp) GetDefault

func (fm *FieldModelTimestamp) GetDefault(defaults Timestamp) (Timestamp, error)

Get the timestamp value with provided default value

func (*FieldModelTimestamp) Set

func (fm *FieldModelTimestamp) Set(value Timestamp) error

Set the timestamp value

func (*FieldModelTimestamp) SetFBEOffset

func (fm *FieldModelTimestamp) SetFBEOffset(value int)

Set the field offset

func (*FieldModelTimestamp) Verify

func (fm *FieldModelTimestamp) Verify() bool

Check if the timestamp value is valid

type FieldModelUInt16

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

Fast Binary Encoding UInt16 field model

func NewFieldModelUInt16

func NewFieldModelUInt16(buffer *Buffer, offset int) *FieldModelUInt16

Create a new UInt16 field model

func (*FieldModelUInt16) FBEExtra

func (fm *FieldModelUInt16) FBEExtra() int

Get the field extra size

func (*FieldModelUInt16) FBEOffset

func (fm *FieldModelUInt16) FBEOffset() int

Get the field offset

func (*FieldModelUInt16) FBEShift

func (fm *FieldModelUInt16) FBEShift(size int)

Shift the current field offset

func (*FieldModelUInt16) FBESize

func (fm *FieldModelUInt16) FBESize() int

Get the field size

func (*FieldModelUInt16) FBEUnshift

func (fm *FieldModelUInt16) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelUInt16) Get

func (fm *FieldModelUInt16) Get() (uint16, error)

Get the value

func (*FieldModelUInt16) GetDefault

func (fm *FieldModelUInt16) GetDefault(defaults uint16) (uint16, error)

Get the value with provided default value

func (*FieldModelUInt16) Set

func (fm *FieldModelUInt16) Set(value uint16) error

Set the value

func (*FieldModelUInt16) SetFBEOffset

func (fm *FieldModelUInt16) SetFBEOffset(value int)

Set the field offset

func (*FieldModelUInt16) Verify

func (fm *FieldModelUInt16) Verify() bool

Check if the value is valid

type FieldModelUInt32

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

Fast Binary Encoding UInt32 field model

func NewFieldModelUInt32

func NewFieldModelUInt32(buffer *Buffer, offset int) *FieldModelUInt32

Create a new UInt32 field model

func (*FieldModelUInt32) FBEExtra

func (fm *FieldModelUInt32) FBEExtra() int

Get the field extra size

func (*FieldModelUInt32) FBEOffset

func (fm *FieldModelUInt32) FBEOffset() int

Get the field offset

func (*FieldModelUInt32) FBEShift

func (fm *FieldModelUInt32) FBEShift(size int)

Shift the current field offset

func (*FieldModelUInt32) FBESize

func (fm *FieldModelUInt32) FBESize() int

Get the field size

func (*FieldModelUInt32) FBEUnshift

func (fm *FieldModelUInt32) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelUInt32) Get

func (fm *FieldModelUInt32) Get() (uint32, error)

Get the value

func (*FieldModelUInt32) GetDefault

func (fm *FieldModelUInt32) GetDefault(defaults uint32) (uint32, error)

Get the value with provided default value

func (*FieldModelUInt32) Set

func (fm *FieldModelUInt32) Set(value uint32) error

Set the value

func (*FieldModelUInt32) SetFBEOffset

func (fm *FieldModelUInt32) SetFBEOffset(value int)

Set the field offset

func (*FieldModelUInt32) Verify

func (fm *FieldModelUInt32) Verify() bool

Check if the value is valid

type FieldModelUInt64

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

Fast Binary Encoding UInt64 field model

func NewFieldModelUInt64

func NewFieldModelUInt64(buffer *Buffer, offset int) *FieldModelUInt64

Create a new UInt64 field model

func (*FieldModelUInt64) FBEExtra

func (fm *FieldModelUInt64) FBEExtra() int

Get the field extra size

func (*FieldModelUInt64) FBEOffset

func (fm *FieldModelUInt64) FBEOffset() int

Get the field offset

func (*FieldModelUInt64) FBEShift

func (fm *FieldModelUInt64) FBEShift(size int)

Shift the current field offset

func (*FieldModelUInt64) FBESize

func (fm *FieldModelUInt64) FBESize() int

Get the field size

func (*FieldModelUInt64) FBEUnshift

func (fm *FieldModelUInt64) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelUInt64) Get

func (fm *FieldModelUInt64) Get() (uint64, error)

Get the value

func (*FieldModelUInt64) GetDefault

func (fm *FieldModelUInt64) GetDefault(defaults uint64) (uint64, error)

Get the value with provided default value

func (*FieldModelUInt64) Set

func (fm *FieldModelUInt64) Set(value uint64) error

Set the value

func (*FieldModelUInt64) SetFBEOffset

func (fm *FieldModelUInt64) SetFBEOffset(value int)

Set the field offset

func (*FieldModelUInt64) Verify

func (fm *FieldModelUInt64) Verify() bool

Check if the value is valid

type FieldModelUInt8

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

Fast Binary Encoding UInt8 field model

func NewFieldModelUInt8

func NewFieldModelUInt8(buffer *Buffer, offset int) *FieldModelUInt8

Create a new UInt8 field model

func (*FieldModelUInt8) FBEExtra

func (fm *FieldModelUInt8) FBEExtra() int

Get the field extra size

func (*FieldModelUInt8) FBEOffset

func (fm *FieldModelUInt8) FBEOffset() int

Get the field offset

func (*FieldModelUInt8) FBEShift

func (fm *FieldModelUInt8) FBEShift(size int)

Shift the current field offset

func (*FieldModelUInt8) FBESize

func (fm *FieldModelUInt8) FBESize() int

Get the field size

func (*FieldModelUInt8) FBEUnshift

func (fm *FieldModelUInt8) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelUInt8) Get

func (fm *FieldModelUInt8) Get() (uint8, error)

Get the value

func (*FieldModelUInt8) GetDefault

func (fm *FieldModelUInt8) GetDefault(defaults uint8) (uint8, error)

Get the value with provided default value

func (*FieldModelUInt8) Set

func (fm *FieldModelUInt8) Set(value uint8) error

Set the value

func (*FieldModelUInt8) SetFBEOffset

func (fm *FieldModelUInt8) SetFBEOffset(value int)

Set the field offset

func (*FieldModelUInt8) Verify

func (fm *FieldModelUInt8) Verify() bool

Check if the value is valid

type FieldModelUUID

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

Fast Binary Encoding UUID field model

func NewFieldModelUUID

func NewFieldModelUUID(buffer *Buffer, offset int) *FieldModelUUID

Create a new UUID field model

func (*FieldModelUUID) FBEExtra

func (fm *FieldModelUUID) FBEExtra() int

Get the field extra size

func (*FieldModelUUID) FBEOffset

func (fm *FieldModelUUID) FBEOffset() int

Get the field offset

func (*FieldModelUUID) FBEShift

func (fm *FieldModelUUID) FBEShift(size int)

Shift the current field offset

func (*FieldModelUUID) FBESize

func (fm *FieldModelUUID) FBESize() int

Get the field size

func (*FieldModelUUID) FBEUnshift

func (fm *FieldModelUUID) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelUUID) Get

func (fm *FieldModelUUID) Get() (UUID, error)

Get the UUID value

func (*FieldModelUUID) GetDefault

func (fm *FieldModelUUID) GetDefault(defaults UUID) (UUID, error)

Get the UUID value with provided default value

func (*FieldModelUUID) Set

func (fm *FieldModelUUID) Set(value UUID) error

Set the UUID value

func (*FieldModelUUID) SetFBEOffset

func (fm *FieldModelUUID) SetFBEOffset(value int)

Set the field offset

func (*FieldModelUUID) Verify

func (fm *FieldModelUUID) Verify() bool

Check if the UUID value is valid

type FieldModelWChar

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

Fast Binary Encoding WChar field model

func NewFieldModelWChar

func NewFieldModelWChar(buffer *Buffer, offset int) *FieldModelWChar

Create a new WChar field model

func (*FieldModelWChar) FBEExtra

func (fm *FieldModelWChar) FBEExtra() int

Get the field extra size

func (*FieldModelWChar) FBEOffset

func (fm *FieldModelWChar) FBEOffset() int

Get the field offset

func (*FieldModelWChar) FBEShift

func (fm *FieldModelWChar) FBEShift(size int)

Shift the current field offset

func (*FieldModelWChar) FBESize

func (fm *FieldModelWChar) FBESize() int

Get the field size

func (*FieldModelWChar) FBEUnshift

func (fm *FieldModelWChar) FBEUnshift(size int)

Unshift the current field offset

func (*FieldModelWChar) Get

func (fm *FieldModelWChar) Get() (rune, error)

Get the value

func (*FieldModelWChar) GetDefault

func (fm *FieldModelWChar) GetDefault(defaults rune) (rune, error)

Get the value with provided default value

func (*FieldModelWChar) Set

func (fm *FieldModelWChar) Set(value rune) error

Set the value

func (*FieldModelWChar) SetFBEOffset

func (fm *FieldModelWChar) SetFBEOffset(value int)

Set the field offset

func (*FieldModelWChar) Verify

func (fm *FieldModelWChar) Verify() bool

Check if the value is valid

type FinalModelBool

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

Fast Binary Encoding Bool final model

func NewFinalModelBool

func NewFinalModelBool(buffer *Buffer, offset int) *FinalModelBool

Create a new Bool final model

func (*FinalModelBool) FBEAllocationSize

func (fm *FinalModelBool) FBEAllocationSize(value bool) int

Get the allocation size

func (*FinalModelBool) FBEOffset

func (fm *FinalModelBool) FBEOffset() int

Get the final offset

func (*FinalModelBool) FBEShift

func (fm *FinalModelBool) FBEShift(size int)

Shift the current final offset

func (*FinalModelBool) FBESize

func (fm *FinalModelBool) FBESize() int

Get the final size

func (*FinalModelBool) FBEUnshift

func (fm *FinalModelBool) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelBool) Get

func (fm *FinalModelBool) Get() (bool, int, error)

Get the value

func (*FinalModelBool) Set

func (fm *FinalModelBool) Set(value bool) (int, error)

Set the value

func (*FinalModelBool) SetFBEOffset

func (fm *FinalModelBool) SetFBEOffset(value int)

Set the final offset

func (*FinalModelBool) Verify

func (fm *FinalModelBool) Verify() int

Check if the value is valid

type FinalModelByte

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

Fast Binary Encoding Byte final model

func NewFinalModelByte

func NewFinalModelByte(buffer *Buffer, offset int) *FinalModelByte

Create a new Byte final model

func (*FinalModelByte) FBEAllocationSize

func (fm *FinalModelByte) FBEAllocationSize(value byte) int

Get the allocation size

func (*FinalModelByte) FBEOffset

func (fm *FinalModelByte) FBEOffset() int

Get the final offset

func (*FinalModelByte) FBEShift

func (fm *FinalModelByte) FBEShift(size int)

Shift the current final offset

func (*FinalModelByte) FBESize

func (fm *FinalModelByte) FBESize() int

Get the final size

func (*FinalModelByte) FBEUnshift

func (fm *FinalModelByte) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelByte) Get

func (fm *FinalModelByte) Get() (byte, int, error)

Get the value

func (*FinalModelByte) Set

func (fm *FinalModelByte) Set(value byte) (int, error)

Set the value

func (*FinalModelByte) SetFBEOffset

func (fm *FinalModelByte) SetFBEOffset(value int)

Set the final offset

func (*FinalModelByte) Verify

func (fm *FinalModelByte) Verify() int

Check if the value is valid

type FinalModelBytes

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

Fast Binary Encoding bytes final model

func NewFinalModelBytes

func NewFinalModelBytes(buffer *Buffer, offset int) *FinalModelBytes

Create a new bytes final model

func (*FinalModelBytes) FBEAllocationSize

func (fm *FinalModelBytes) FBEAllocationSize(value []byte) int

Get the allocation size

func (*FinalModelBytes) FBEOffset

func (fm *FinalModelBytes) FBEOffset() int

Get the final offset

func (*FinalModelBytes) FBEShift

func (fm *FinalModelBytes) FBEShift(size int)

Shift the current final offset

func (*FinalModelBytes) FBEUnshift

func (fm *FinalModelBytes) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelBytes) Get

func (fm *FinalModelBytes) Get() ([]byte, int, error)

Get the bytes value

func (*FinalModelBytes) Set

func (fm *FinalModelBytes) Set(value []byte) (int, error)

Set the bytes value

func (*FinalModelBytes) SetFBEOffset

func (fm *FinalModelBytes) SetFBEOffset(value int)

Set the final offset

func (*FinalModelBytes) Verify

func (fm *FinalModelBytes) Verify() int

Check if the bytes value is valid

type FinalModelChar

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

Fast Binary Encoding Char final model

func NewFinalModelChar

func NewFinalModelChar(buffer *Buffer, offset int) *FinalModelChar

Create a new Char final model

func (*FinalModelChar) FBEAllocationSize

func (fm *FinalModelChar) FBEAllocationSize(value rune) int

Get the allocation size

func (*FinalModelChar) FBEOffset

func (fm *FinalModelChar) FBEOffset() int

Get the final offset

func (*FinalModelChar) FBEShift

func (fm *FinalModelChar) FBEShift(size int)

Shift the current final offset

func (*FinalModelChar) FBESize

func (fm *FinalModelChar) FBESize() int

Get the final size

func (*FinalModelChar) FBEUnshift

func (fm *FinalModelChar) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelChar) Get

func (fm *FinalModelChar) Get() (rune, int, error)

Get the value

func (*FinalModelChar) Set

func (fm *FinalModelChar) Set(value rune) (int, error)

Set the value

func (*FinalModelChar) SetFBEOffset

func (fm *FinalModelChar) SetFBEOffset(value int)

Set the final offset

func (*FinalModelChar) Verify

func (fm *FinalModelChar) Verify() int

Check if the value is valid

type FinalModelDecimal

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

Fast Binary Encoding decimal final model

func NewFinalModelDecimal

func NewFinalModelDecimal(buffer *Buffer, offset int) *FinalModelDecimal

Create a new decimal final model

func (*FinalModelDecimal) FBEAllocationSize

func (fm *FinalModelDecimal) FBEAllocationSize(value Decimal) int

Get the allocation size

func (*FinalModelDecimal) FBEOffset

func (fm *FinalModelDecimal) FBEOffset() int

Get the final offset

func (*FinalModelDecimal) FBEShift

func (fm *FinalModelDecimal) FBEShift(size int)

Shift the current final offset

func (*FinalModelDecimal) FBESize

func (fm *FinalModelDecimal) FBESize() int

Get the final size

func (*FinalModelDecimal) FBEUnshift

func (fm *FinalModelDecimal) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelDecimal) Get

func (fm *FinalModelDecimal) Get() (Decimal, int, error)

Get the decimal value

func (*FinalModelDecimal) Set

func (fm *FinalModelDecimal) Set(value Decimal) (int, error)

Set the decimal value

func (*FinalModelDecimal) SetFBEOffset

func (fm *FinalModelDecimal) SetFBEOffset(value int)

Set the final offset

func (*FinalModelDecimal) Verify

func (fm *FinalModelDecimal) Verify() int

Check if the decimal value is valid

type FinalModelDouble

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

Fast Binary Encoding Double final model

func NewFinalModelDouble

func NewFinalModelDouble(buffer *Buffer, offset int) *FinalModelDouble

Create a new Double final model

func (*FinalModelDouble) FBEAllocationSize

func (fm *FinalModelDouble) FBEAllocationSize(value float64) int

Get the allocation size

func (*FinalModelDouble) FBEOffset

func (fm *FinalModelDouble) FBEOffset() int

Get the final offset

func (*FinalModelDouble) FBEShift

func (fm *FinalModelDouble) FBEShift(size int)

Shift the current final offset

func (*FinalModelDouble) FBESize

func (fm *FinalModelDouble) FBESize() int

Get the final size

func (*FinalModelDouble) FBEUnshift

func (fm *FinalModelDouble) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelDouble) Get

func (fm *FinalModelDouble) Get() (float64, int, error)

Get the value

func (*FinalModelDouble) Set

func (fm *FinalModelDouble) Set(value float64) (int, error)

Set the value

func (*FinalModelDouble) SetFBEOffset

func (fm *FinalModelDouble) SetFBEOffset(value int)

Set the final offset

func (*FinalModelDouble) Verify

func (fm *FinalModelDouble) Verify() int

Check if the value is valid

type FinalModelFloat

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

Fast Binary Encoding Float final model

func NewFinalModelFloat

func NewFinalModelFloat(buffer *Buffer, offset int) *FinalModelFloat

Create a new Float final model

func (*FinalModelFloat) FBEAllocationSize

func (fm *FinalModelFloat) FBEAllocationSize(value float32) int

Get the allocation size

func (*FinalModelFloat) FBEOffset

func (fm *FinalModelFloat) FBEOffset() int

Get the final offset

func (*FinalModelFloat) FBEShift

func (fm *FinalModelFloat) FBEShift(size int)

Shift the current final offset

func (*FinalModelFloat) FBESize

func (fm *FinalModelFloat) FBESize() int

Get the final size

func (*FinalModelFloat) FBEUnshift

func (fm *FinalModelFloat) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelFloat) Get

func (fm *FinalModelFloat) Get() (float32, int, error)

Get the value

func (*FinalModelFloat) Set

func (fm *FinalModelFloat) Set(value float32) (int, error)

Set the value

func (*FinalModelFloat) SetFBEOffset

func (fm *FinalModelFloat) SetFBEOffset(value int)

Set the final offset

func (*FinalModelFloat) Verify

func (fm *FinalModelFloat) Verify() int

Check if the value is valid

type FinalModelInt16

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

Fast Binary Encoding Int16 final model

func NewFinalModelInt16

func NewFinalModelInt16(buffer *Buffer, offset int) *FinalModelInt16

Create a new Int16 final model

func (*FinalModelInt16) FBEAllocationSize

func (fm *FinalModelInt16) FBEAllocationSize(value int16) int

Get the allocation size

func (*FinalModelInt16) FBEOffset

func (fm *FinalModelInt16) FBEOffset() int

Get the final offset

func (*FinalModelInt16) FBEShift

func (fm *FinalModelInt16) FBEShift(size int)

Shift the current final offset

func (*FinalModelInt16) FBESize

func (fm *FinalModelInt16) FBESize() int

Get the final size

func (*FinalModelInt16) FBEUnshift

func (fm *FinalModelInt16) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelInt16) Get

func (fm *FinalModelInt16) Get() (int16, int, error)

Get the value

func (*FinalModelInt16) Set

func (fm *FinalModelInt16) Set(value int16) (int, error)

Set the value

func (*FinalModelInt16) SetFBEOffset

func (fm *FinalModelInt16) SetFBEOffset(value int)

Set the final offset

func (*FinalModelInt16) Verify

func (fm *FinalModelInt16) Verify() int

Check if the value is valid

type FinalModelInt32

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

Fast Binary Encoding Int32 final model

func NewFinalModelInt32

func NewFinalModelInt32(buffer *Buffer, offset int) *FinalModelInt32

Create a new Int32 final model

func (*FinalModelInt32) FBEAllocationSize

func (fm *FinalModelInt32) FBEAllocationSize(value int32) int

Get the allocation size

func (*FinalModelInt32) FBEOffset

func (fm *FinalModelInt32) FBEOffset() int

Get the final offset

func (*FinalModelInt32) FBEShift

func (fm *FinalModelInt32) FBEShift(size int)

Shift the current final offset

func (*FinalModelInt32) FBESize

func (fm *FinalModelInt32) FBESize() int

Get the final size

func (*FinalModelInt32) FBEUnshift

func (fm *FinalModelInt32) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelInt32) Get

func (fm *FinalModelInt32) Get() (int32, int, error)

Get the value

func (*FinalModelInt32) Set

func (fm *FinalModelInt32) Set(value int32) (int, error)

Set the value

func (*FinalModelInt32) SetFBEOffset

func (fm *FinalModelInt32) SetFBEOffset(value int)

Set the final offset

func (*FinalModelInt32) Verify

func (fm *FinalModelInt32) Verify() int

Check if the value is valid

type FinalModelInt64

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

Fast Binary Encoding Int64 final model

func NewFinalModelInt64

func NewFinalModelInt64(buffer *Buffer, offset int) *FinalModelInt64

Create a new Int64 final model

func (*FinalModelInt64) FBEAllocationSize

func (fm *FinalModelInt64) FBEAllocationSize(value int64) int

Get the allocation size

func (*FinalModelInt64) FBEOffset

func (fm *FinalModelInt64) FBEOffset() int

Get the final offset

func (*FinalModelInt64) FBEShift

func (fm *FinalModelInt64) FBEShift(size int)

Shift the current final offset

func (*FinalModelInt64) FBESize

func (fm *FinalModelInt64) FBESize() int

Get the final size

func (*FinalModelInt64) FBEUnshift

func (fm *FinalModelInt64) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelInt64) Get

func (fm *FinalModelInt64) Get() (int64, int, error)

Get the value

func (*FinalModelInt64) Set

func (fm *FinalModelInt64) Set(value int64) (int, error)

Set the value

func (*FinalModelInt64) SetFBEOffset

func (fm *FinalModelInt64) SetFBEOffset(value int)

Set the final offset

func (*FinalModelInt64) Verify

func (fm *FinalModelInt64) Verify() int

Check if the value is valid

type FinalModelInt8

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

Fast Binary Encoding Int8 final model

func NewFinalModelInt8

func NewFinalModelInt8(buffer *Buffer, offset int) *FinalModelInt8

Create a new Int8 final model

func (*FinalModelInt8) FBEAllocationSize

func (fm *FinalModelInt8) FBEAllocationSize(value int8) int

Get the allocation size

func (*FinalModelInt8) FBEOffset

func (fm *FinalModelInt8) FBEOffset() int

Get the final offset

func (*FinalModelInt8) FBEShift

func (fm *FinalModelInt8) FBEShift(size int)

Shift the current final offset

func (*FinalModelInt8) FBESize

func (fm *FinalModelInt8) FBESize() int

Get the final size

func (*FinalModelInt8) FBEUnshift

func (fm *FinalModelInt8) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelInt8) Get

func (fm *FinalModelInt8) Get() (int8, int, error)

Get the value

func (*FinalModelInt8) Set

func (fm *FinalModelInt8) Set(value int8) (int, error)

Set the value

func (*FinalModelInt8) SetFBEOffset

func (fm *FinalModelInt8) SetFBEOffset(value int)

Set the final offset

func (*FinalModelInt8) Verify

func (fm *FinalModelInt8) Verify() int

Check if the value is valid

type FinalModelString

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

Fast Binary Encoding string final model

func NewFinalModelString

func NewFinalModelString(buffer *Buffer, offset int) *FinalModelString

Create a new string final model

func (*FinalModelString) FBEAllocationSize

func (fm *FinalModelString) FBEAllocationSize(value string) int

Get the allocation size

func (*FinalModelString) FBEOffset

func (fm *FinalModelString) FBEOffset() int

Get the final offset

func (*FinalModelString) FBEShift

func (fm *FinalModelString) FBEShift(size int)

Shift the current final offset

func (*FinalModelString) FBEUnshift

func (fm *FinalModelString) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelString) Get

func (fm *FinalModelString) Get() (string, int, error)

Get the string value

func (*FinalModelString) Set

func (fm *FinalModelString) Set(value string) (int, error)

Set the string value

func (*FinalModelString) SetFBEOffset

func (fm *FinalModelString) SetFBEOffset(value int)

Set the final offset

func (*FinalModelString) Verify

func (fm *FinalModelString) Verify() int

Check if the string value is valid

type FinalModelTimestamp

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

Fast Binary Encoding timestamp final model

func NewFinalModelTimestamp

func NewFinalModelTimestamp(buffer *Buffer, offset int) *FinalModelTimestamp

Create a new timestamp final model

func (*FinalModelTimestamp) FBEAllocationSize

func (fm *FinalModelTimestamp) FBEAllocationSize(value Timestamp) int

Get the allocation size

func (*FinalModelTimestamp) FBEOffset

func (fm *FinalModelTimestamp) FBEOffset() int

Get the final offset

func (*FinalModelTimestamp) FBEShift

func (fm *FinalModelTimestamp) FBEShift(size int)

Shift the current final offset

func (*FinalModelTimestamp) FBESize

func (fm *FinalModelTimestamp) FBESize() int

Get the final size

func (*FinalModelTimestamp) FBEUnshift

func (fm *FinalModelTimestamp) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelTimestamp) Get

func (fm *FinalModelTimestamp) Get() (Timestamp, int, error)

Get the timestamp value

func (*FinalModelTimestamp) Set

func (fm *FinalModelTimestamp) Set(value Timestamp) (int, error)

Set the timestamp value

func (*FinalModelTimestamp) SetFBEOffset

func (fm *FinalModelTimestamp) SetFBEOffset(value int)

Set the final offset

func (*FinalModelTimestamp) Verify

func (fm *FinalModelTimestamp) Verify() int

Check if the timestamp value is valid

type FinalModelUInt16

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

Fast Binary Encoding UInt16 final model

func NewFinalModelUInt16

func NewFinalModelUInt16(buffer *Buffer, offset int) *FinalModelUInt16

Create a new UInt16 final model

func (*FinalModelUInt16) FBEAllocationSize

func (fm *FinalModelUInt16) FBEAllocationSize(value uint16) int

Get the allocation size

func (*FinalModelUInt16) FBEOffset

func (fm *FinalModelUInt16) FBEOffset() int

Get the final offset

func (*FinalModelUInt16) FBEShift

func (fm *FinalModelUInt16) FBEShift(size int)

Shift the current final offset

func (*FinalModelUInt16) FBESize

func (fm *FinalModelUInt16) FBESize() int

Get the final size

func (*FinalModelUInt16) FBEUnshift

func (fm *FinalModelUInt16) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelUInt16) Get

func (fm *FinalModelUInt16) Get() (uint16, int, error)

Get the value

func (*FinalModelUInt16) Set

func (fm *FinalModelUInt16) Set(value uint16) (int, error)

Set the value

func (*FinalModelUInt16) SetFBEOffset

func (fm *FinalModelUInt16) SetFBEOffset(value int)

Set the final offset

func (*FinalModelUInt16) Verify

func (fm *FinalModelUInt16) Verify() int

Check if the value is valid

type FinalModelUInt32

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

Fast Binary Encoding UInt32 final model

func NewFinalModelUInt32

func NewFinalModelUInt32(buffer *Buffer, offset int) *FinalModelUInt32

Create a new UInt32 final model

func (*FinalModelUInt32) FBEAllocationSize

func (fm *FinalModelUInt32) FBEAllocationSize(value uint32) int

Get the allocation size

func (*FinalModelUInt32) FBEOffset

func (fm *FinalModelUInt32) FBEOffset() int

Get the final offset

func (*FinalModelUInt32) FBEShift

func (fm *FinalModelUInt32) FBEShift(size int)

Shift the current final offset

func (*FinalModelUInt32) FBESize

func (fm *FinalModelUInt32) FBESize() int

Get the final size

func (*FinalModelUInt32) FBEUnshift

func (fm *FinalModelUInt32) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelUInt32) Get

func (fm *FinalModelUInt32) Get() (uint32, int, error)

Get the value

func (*FinalModelUInt32) Set

func (fm *FinalModelUInt32) Set(value uint32) (int, error)

Set the value

func (*FinalModelUInt32) SetFBEOffset

func (fm *FinalModelUInt32) SetFBEOffset(value int)

Set the final offset

func (*FinalModelUInt32) Verify

func (fm *FinalModelUInt32) Verify() int

Check if the value is valid

type FinalModelUInt64

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

Fast Binary Encoding UInt64 final model

func NewFinalModelUInt64

func NewFinalModelUInt64(buffer *Buffer, offset int) *FinalModelUInt64

Create a new UInt64 final model

func (*FinalModelUInt64) FBEAllocationSize

func (fm *FinalModelUInt64) FBEAllocationSize(value uint64) int

Get the allocation size

func (*FinalModelUInt64) FBEOffset

func (fm *FinalModelUInt64) FBEOffset() int

Get the final offset

func (*FinalModelUInt64) FBEShift

func (fm *FinalModelUInt64) FBEShift(size int)

Shift the current final offset

func (*FinalModelUInt64) FBESize

func (fm *FinalModelUInt64) FBESize() int

Get the final size

func (*FinalModelUInt64) FBEUnshift

func (fm *FinalModelUInt64) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelUInt64) Get

func (fm *FinalModelUInt64) Get() (uint64, int, error)

Get the value

func (*FinalModelUInt64) Set

func (fm *FinalModelUInt64) Set(value uint64) (int, error)

Set the value

func (*FinalModelUInt64) SetFBEOffset

func (fm *FinalModelUInt64) SetFBEOffset(value int)

Set the final offset

func (*FinalModelUInt64) Verify

func (fm *FinalModelUInt64) Verify() int

Check if the value is valid

type FinalModelUInt8

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

Fast Binary Encoding UInt8 final model

func NewFinalModelUInt8

func NewFinalModelUInt8(buffer *Buffer, offset int) *FinalModelUInt8

Create a new UInt8 final model

func (*FinalModelUInt8) FBEAllocationSize

func (fm *FinalModelUInt8) FBEAllocationSize(value uint8) int

Get the allocation size

func (*FinalModelUInt8) FBEOffset

func (fm *FinalModelUInt8) FBEOffset() int

Get the final offset

func (*FinalModelUInt8) FBEShift

func (fm *FinalModelUInt8) FBEShift(size int)

Shift the current final offset

func (*FinalModelUInt8) FBESize

func (fm *FinalModelUInt8) FBESize() int

Get the final size

func (*FinalModelUInt8) FBEUnshift

func (fm *FinalModelUInt8) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelUInt8) Get

func (fm *FinalModelUInt8) Get() (uint8, int, error)

Get the value

func (*FinalModelUInt8) Set

func (fm *FinalModelUInt8) Set(value uint8) (int, error)

Set the value

func (*FinalModelUInt8) SetFBEOffset

func (fm *FinalModelUInt8) SetFBEOffset(value int)

Set the final offset

func (*FinalModelUInt8) Verify

func (fm *FinalModelUInt8) Verify() int

Check if the value is valid

type FinalModelUUID

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

Fast Binary Encoding UUID final model

func NewFinalModelUUID

func NewFinalModelUUID(buffer *Buffer, offset int) *FinalModelUUID

Create a new UUID final model

func (*FinalModelUUID) FBEAllocationSize

func (fm *FinalModelUUID) FBEAllocationSize(value UUID) int

Get the allocation size

func (*FinalModelUUID) FBEOffset

func (fm *FinalModelUUID) FBEOffset() int

Get the final offset

func (*FinalModelUUID) FBEShift

func (fm *FinalModelUUID) FBEShift(size int)

Shift the current final offset

func (*FinalModelUUID) FBESize

func (fm *FinalModelUUID) FBESize() int

Get the final size

func (*FinalModelUUID) FBEUnshift

func (fm *FinalModelUUID) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelUUID) Get

func (fm *FinalModelUUID) Get() (UUID, int, error)

Get the UUID value

func (*FinalModelUUID) Set

func (fm *FinalModelUUID) Set(value UUID) (int, error)

Set the UUID value

func (*FinalModelUUID) SetFBEOffset

func (fm *FinalModelUUID) SetFBEOffset(value int)

Set the final offset

func (*FinalModelUUID) Verify

func (fm *FinalModelUUID) Verify() int

Check if the UUID value is valid

type FinalModelWChar

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

Fast Binary Encoding WChar final model

func NewFinalModelWChar

func NewFinalModelWChar(buffer *Buffer, offset int) *FinalModelWChar

Create a new WChar final model

func (*FinalModelWChar) FBEAllocationSize

func (fm *FinalModelWChar) FBEAllocationSize(value rune) int

Get the allocation size

func (*FinalModelWChar) FBEOffset

func (fm *FinalModelWChar) FBEOffset() int

Get the final offset

func (*FinalModelWChar) FBEShift

func (fm *FinalModelWChar) FBEShift(size int)

Shift the current final offset

func (*FinalModelWChar) FBESize

func (fm *FinalModelWChar) FBESize() int

Get the final size

func (*FinalModelWChar) FBEUnshift

func (fm *FinalModelWChar) FBEUnshift(size int)

Unshift the current final offset

func (*FinalModelWChar) Get

func (fm *FinalModelWChar) Get() (rune, int, error)

Get the value

func (*FinalModelWChar) Set

func (fm *FinalModelWChar) Set(value rune) (int, error)

Set the value

func (*FinalModelWChar) SetFBEOffset

func (fm *FinalModelWChar) SetFBEOffset(value int)

Set the final offset

func (*FinalModelWChar) Verify

func (fm *FinalModelWChar) Verify() int

Check if the value is valid

type OnReceive

type OnReceive interface {
	OnReceive(fbeType int, buffer []byte) (bool, error)
}

Receive message interface

type OnReceiveFunc

type OnReceiveFunc func(fbeType int, buffer []byte) (bool, error)

Receive message function

func (OnReceiveFunc) OnReceive

func (f OnReceiveFunc) OnReceive(fbeType int, buffer []byte) (bool, error)

type OnReceiveLog

type OnReceiveLog interface {
	OnReceiveLog(message string)
}

Receive log message interface

type OnReceiveLogFunc

type OnReceiveLogFunc func(message string)

Receive log message function

func (OnReceiveLogFunc) OnReceiveLog

func (f OnReceiveLogFunc) OnReceiveLog(message string)

type OnSend

type OnSend interface {
	OnSend(buffer []byte) (int, error)
}

Send message interface

type OnSendFunc

type OnSendFunc func(buffer []byte) (int, error)

Send message function

func (OnSendFunc) OnSend

func (f OnSendFunc) OnSend(buffer []byte) (int, error)

type OnSendLog

type OnSendLog interface {
	OnSendLog(message string)
}

Send log message interface

type OnSendLogFunc

type OnSendLogFunc func(message string)

Send log message function

func (OnSendLogFunc) OnSendLog

func (f OnSendLogFunc) OnSendLog(message string)

type Receiver

type Receiver struct {

	// Receive message handler
	HandlerOnReceive OnReceive
	// Receive log message handler
	HandlerOnReceiveLog OnReceiveLog
	// contains filtered or unexported fields
}

Fast Binary Encoding base receiver

func NewReceiver

func NewReceiver(buffer *Buffer, final bool) *Receiver

Create a new base receiver

func (*Receiver) Buffer

func (r *Receiver) Buffer() *Buffer

Get the bytes buffer

func (*Receiver) Final

func (r *Receiver) Final() bool

Get the final protocol flag

func (*Receiver) Logging

func (r *Receiver) Logging() bool

Get the logging flag

func (*Receiver) Receive

func (r *Receiver) Receive(buffer []byte) error

Receive bytes memory buffer

func (*Receiver) ReceiveBuffer

func (r *Receiver) ReceiveBuffer(buffer *Buffer) error

Receive buffer

func (*Receiver) Reset

func (r *Receiver) Reset()

Reset the receiver buffer

func (*Receiver) SetLogging

func (r *Receiver) SetLogging(logging bool)

Set the logging flag

func (*Receiver) SetupHandlerOnReceive

func (r *Receiver) SetupHandlerOnReceive(handler OnReceive)

Setup receive message handler

func (*Receiver) SetupHandlerOnReceiveFunc

func (r *Receiver) SetupHandlerOnReceiveFunc(function func(fbeType int, buffer []byte) (bool, error))

Setup receive message handler function

func (*Receiver) SetupHandlerOnReceiveLog

func (r *Receiver) SetupHandlerOnReceiveLog(handler OnReceiveLog)

Setup receive log message handler

func (*Receiver) SetupHandlerOnReceiveLogFunc

func (r *Receiver) SetupHandlerOnReceiveLogFunc(function func(message string))

Setup receive log message handler function

func (*Receiver) SetupHandlers

func (r *Receiver) SetupHandlers(handlers interface{})

Setup handlers

type Sender

type Sender struct {

	// Send message handler
	HandlerOnSend OnSend
	// Send log message handler
	HandlerOnSendLog OnSendLog
	// contains filtered or unexported fields
}

Fast Binary Encoding base sender

func NewSender

func NewSender(buffer *Buffer, final bool) *Sender

Create a new base sender

func (*Sender) Buffer

func (s *Sender) Buffer() *Buffer

Get the bytes buffer

func (*Sender) Final

func (s *Sender) Final() bool

Get the final protocol flag

func (*Sender) Logging

func (s *Sender) Logging() bool

Get the logging flag

func (*Sender) Reset

func (s *Sender) Reset()

Reset the sender buffer

func (*Sender) SendSerialized

func (s *Sender) SendSerialized(serialized int) (int, error)

Send serialized buffer. Direct call of the method requires knowledge about internals of FBE models serialization. Use it with care!

func (*Sender) SetLogging

func (s *Sender) SetLogging(logging bool)

Set the logging flag

func (*Sender) SetupHandlerOnSend

func (s *Sender) SetupHandlerOnSend(handler OnSend)

Setup send message handler

func (*Sender) SetupHandlerOnSendFunc

func (s *Sender) SetupHandlerOnSendFunc(function func(buffer []byte) (int, error))

Setup send message handler function

func (*Sender) SetupHandlerOnSendLog

func (s *Sender) SetupHandlerOnSendLog(handler OnSendLog)

Setup send log message handler

func (*Sender) SetupHandlerOnSendLogFunc

func (s *Sender) SetupHandlerOnSendLogFunc(function func(message string))

Setup send log message handler function

func (*Sender) SetupHandlers

func (s *Sender) SetupHandlers(handlers interface{})

Setup handlers

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp struct

func OptionalTimestamp

func OptionalTimestamp(value Timestamp) *Timestamp

Create an optional timestamp

func ReadTimestamp

func ReadTimestamp(buffer []byte, offset int) Timestamp

Read timestamp from the buffer

func TimestampEpoch

func TimestampEpoch() Timestamp

Create Unix Epoch timestamp

func TimestampFromDate

func TimestampFromDate(year, month, day int) Timestamp

Create a new timestamp from the given date

func TimestampFromDateTime

func TimestampFromDateTime(year, month, day, hour, minute, second, nanoseconds int) Timestamp

Create a new timestamp from the given date

func TimestampFromNanoseconds

func TimestampFromNanoseconds(nanoseconds uint64) Timestamp

Create a new timestamp from the given nanoseconds

func TimestampUTC

func TimestampUTC() Timestamp

Create the current UTC timestamp

func (*Timestamp) MarshalJSON

func (t *Timestamp) MarshalJSON() ([]byte, error)

Convert timestamp to JSON

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(buffer []byte) error

Convert JSON to timestamp

type UUID

type UUID struct {
	uuid.UUID
}

UUID struct

func OptionalUUID

func OptionalUUID(value UUID) *UUID

Create an optional UUID

func ReadUUID

func ReadUUID(buffer []byte, offset int) UUID

Read UUID from the buffer

func UUIDFromBytes

func UUIDFromBytes(buffer []byte) UUID

Create a new UUID from the given bytes buffer

func UUIDFromString

func UUIDFromString(value string) UUID

Create a new UUID from the given string

func UUIDNil

func UUIDNil() UUID

Create nil UUID0 (all bits set to zero)

func UUIDRandom

func UUIDRandom() UUID

Create random UUID4 (randomly or pseudo-randomly generated version)

func UUIDSequential

func UUIDSequential() UUID

Create sequential UUID1 (time based version)

Jump to

Keyboard shortcuts

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