Bool represents bool
const Bool = 40
BoolArray represents []bool
const BoolArray = 140
Bytes represents []byte
const Bytes = 50
BytesArray represents [][]byte
const BytesArray = 150
Float32 represents float32
const Float32 = 20
Float32Array represents []float32
const Float32Array = 120
Float64 represents float64
const Float64 = 21
Float64Array represents []float64
const Float64Array = 121
Int represents int
const Int = 1
Int16 represents int16
const Int16 = 3
Int16Array represents []int16
const Int16Array = 103
Int32 represents int32
const Int32 = 4
Int32Array represents []int32
const Int32Array = 104
Int64 represents int64
const Int64 = 5
Int64Array represents []int64
const Int64Array = 105
Int8 represents int8
const Int8 = 2
Int8Array represents []int8
const Int8Array = 102
IntArray represents []int
const IntArray = 100
String represents string
const String = 30
StringArray represents []string
const StringArray = 130
Uint represents uint
const Uint = 10
Uint16 represents uint16
const Uint16 = 12
Uint16Array represents []uint16
const Uint16Array = 112
Uint32 represents uint32
const Uint32 = 13
Uint32Array represents []uint32
const Uint32Array = 113
Uint64 represents uint64
const Uint64 = 14
Uint64Array represents []uint64
const Uint64Array = 114
Uint8 represents uint8
const Uint8 = 11
Uint8Array represents []uint8
const Uint8Array = 111
UintArray represents []uint
const UintArray = 110
func TestTransportData()
TestTransportData executes tests on TransportData. If the test fails it throws a panic.
Property represents a property of a TransportData.
type Property struct { Name string Type int }
TransportData represents the data to be sent and received by remote server nodes.
type TransportData struct { sync.RWMutex // contains filtered or unexported fields }
func (s *TransportData) GetAllPropertyNames() []string
GetAllPropertyNames returns all defined property names as an array.
func (s *TransportData) GetAsBool(name string) (bool, error)
GetAsBool returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsBoolArray(name string) ([]bool, error)
GetAsBoolArray returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsBytes(name string) ([]byte, error)
GetAsBytes returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsBytesArray(name string) ([][]byte, error)
GetAsBytesArray returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsFloat32(name string) (float32, error)
GetAsFloat32 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsFloat32Array(name string) ([]float32, error)
GetAsFloat32Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsFloat64(name string) (float64, error)
GetAsFloat64 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsFloat64Array(name string) ([]float64, error)
GetAsFloat64Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt(name string) (int, error)
GetAsInt returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt16(name string) (int16, error)
GetAsInt16 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt16Array(name string) ([]int16, error)
GetAsInt16Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt32(name string) (int32, error)
GetAsInt32 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt32Array(name string) ([]int32, error)
GetAsInt32Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt64(name string) (int64, error)
GetAsInt64 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt64Array(name string) ([]int64, error)
GetAsInt64Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt8(name string) (int8, error)
GetAsInt8 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsInt8Array(name string) ([]int8, error)
GetAsInt8Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsIntArray(name string) ([]int, error)
GetAsIntArray returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsString(name string) (string, error)
GetAsString returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsStringArray(name string) ([]string, error)
GetAsStringArray returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint(name string) (uint, error)
GetAsUint returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint16(name string) (uint16, error)
GetAsUint16 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint16Array(name string) ([]uint16, error)
GetAsUint16Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint32(name string) (uint32, error)
GetAsUint32 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint32Array(name string) ([]uint32, error)
GetAsUint32Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint64(name string) (uint64, error)
GetAsUint64 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint64Array(name string) ([]uint64, error)
GetAsUint64Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint8(name string) (uint8, error)
GetAsUint8 returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUint8Array(name string) ([]uint8, error)
GetAsUint8Array returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) GetAsUintArray(name string) ([]uint, error)
GetAsUintArray returns the value of the given name. It returns false if the given name has not been defined.
func (s *TransportData) Pack() []byte
Pack encodes the data into byte array.
func (s *TransportData) SetAsBool(name string, value bool) error
SetAsBool assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsBoolArray(name string, value []bool) error
SetAsBoolArray assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsBytes(name string, value []byte) error
SetAsBytes assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsBytesArray(name string, value [][]byte) error
SetAsBytesArray assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsFloat32(name string, value float32) error
SetAsFloat32 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsFloat32Array(name string, value []float32) error
SetAsFloat32Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsFloat64(name string, value float64) error
SetAsFloat64 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsFloat64Array(name string, value []float64) error
SetAsFloat64Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt(name string, value int) error
SetAsInt assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt16(name string, value int16) error
SetAsInt16 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt16Array(name string, value []int16) error
SetAsInt16Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt32(name string, value int32) error
SetAsInt32 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt32Array(name string, value []int32) error
SetAsInt32Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt64(name string, value int64) error
SetAsInt64 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt64Array(name string, value []int64) error
SetAsInt64Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt8(name string, value int8) error
SetAsInt8 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsInt8Array(name string, value []int8) error
SetAsInt8Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsIntArray(name string, value []int) error
SetAsIntArray assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsString(name string, value string) error
SetAsString assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsStringArray(name string, value []string) error
SetAsStringArray assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint(name string, value uint) error
SetAsUint assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint16(name string, value uint16) error
SetAsUint16 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint16Array(name string, value []uint16) error
SetAsUint16Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint32(name string, value uint32) error
SetAsUint32 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint32Array(name string, value []uint32) error
SetAsUint32Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint64(name string, value uint64) error
SetAsUint64 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint64Array(name string, value []uint64) error
SetAsUint64Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint8(name string, value uint8) error
SetAsUint8 assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUint8Array(name string, value []uint8) error
SetAsUint8Array assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) SetAsUintArray(name string, value []uint) error
SetAsUintArray assigns a value to the given name.
It will fail (return an error) if you pass the name and/or type that has not been defined by DefineTransportData.
func (s *TransportData) String() string
String returns a string encoded TransportData's internal data.
func (s *TransportData) Unpack(bytes []byte)
Unpack decodes the encoded TransportData byte array.
TransportDataDefinition represents the definition of a TransportData.
type TransportDataDefinition struct {
// contains filtered or unexported fields
}
func DefineTransportData(properties []Property) *TransportDataDefinition
DefineTransportData creates a data structure definition and returns an instance of TransportDataDefinition.
With the returned instance of TransportDataDefinition, you may create instances of TransportData to create transport data for mesh message delivery.
func (s *TransportDataDefinition) New() *TransportData
New returns an instance of TransportData with the data structure of the defined TransportDataDefinition.