io

package
v0.0.0-...-1fed1ad Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteWithRawWriter

func WriteWithRawWriter[T any, I any](ctx context.Context, logicalName string, value T, enumSerializer func(T) I, enumNamer func(T) string, rawWriter DataWriter[I], args ...utils.WithWriterArgs) error

Types

type ContextReader

type ContextReader interface {
	PullContext(logicalName string, readerArgs ...utils.WithReaderArgs) error
	CloseContext(logicalName string, readerArgs ...utils.WithReaderArgs) error
}

type ContextWriter

type ContextWriter interface {
	PushContext(logicalName string, writerArgs ...utils.WithWriterArgs) error
	PopContext(logicalName string, writerArgs ...utils.WithWriterArgs) error
}

type DataIoSerializerFunction

type DataIoSerializerFunction[T any] interface {
	Apply(T, values.PlcValue) error
}

type DataReader

type DataReader[T any] interface {
	utils.ByteOrderAware
	codegen.PositionMover
	ContextReader
	Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (T, error)
	GetReadBuffer() utils.ReadBuffer
}

func ReadBoolean

func ReadBoolean(readBuffer utils.ReadBuffer) DataReader[bool]

func ReadByte

func ReadByte(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[byte]

func ReadDate

func ReadDate(readBuffer utils.ReadBuffer) DataReader[time.Time]

func ReadDateTime

func ReadDateTime(readBuffer utils.ReadBuffer) DataReader[time.Time]

func ReadDouble

func ReadDouble(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[float64]

func ReadFloat

func ReadFloat(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[float32]

func ReadSignedBigInteger

func ReadSignedBigInteger(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[*big.Int]

func ReadSignedByte

func ReadSignedByte(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[int8]

func ReadSignedInt

func ReadSignedInt(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[int32]

func ReadSignedLong

func ReadSignedLong(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[int64]

func ReadSignedShort

func ReadSignedShort(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[int16]

func ReadString

func ReadString(readBuffer utils.ReadBuffer, bitLength uint32) DataReader[string]

func ReadTime

func ReadTime(readBuffer utils.ReadBuffer) DataReader[time.Time]

func ReadUnsignedBigInteger

func ReadUnsignedBigInteger(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[*big.Int]

func ReadUnsignedByte

func ReadUnsignedByte(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[byte]

func ReadUnsignedInt

func ReadUnsignedInt(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[uint32]

func ReadUnsignedLong

func ReadUnsignedLong(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[uint64]

func ReadUnsignedShort

func ReadUnsignedShort(readBuffer utils.ReadBuffer, bitLength uint8) DataReader[uint16]

type DataReaderComplex

type DataReaderComplex[T any] interface {
	DataReader[T]
	ReadComplex(ctx context.Context, logicalName string, supplier func(context.Context, utils.ReadBuffer) (T, error), readerArgs ...utils.WithReaderArgs) (T, error)
}

type DataReaderComplexDefault

type DataReaderComplexDefault[T any] struct {
	// contains filtered or unexported fields
}

func NewDataReaderComplexDefault

func NewDataReaderComplexDefault[T any](complexTypeSupplier func(context.Context, utils.ReadBuffer) (T, error), readBuffer utils.ReadBuffer) *DataReaderComplexDefault[T]

func ReadComplex

func ReadComplex[T any](complexSupplier func(context.Context, utils.ReadBuffer) (T, error), readBuffer utils.ReadBuffer) *DataReaderComplexDefault[T]

func (*DataReaderComplexDefault[T]) CloseContext

func (d *DataReaderComplexDefault[T]) CloseContext(logicalName string, readerArgs ...utils.WithReaderArgs) error

func (*DataReaderComplexDefault[T]) GetByteOrder

func (d *DataReaderComplexDefault[T]) GetByteOrder() binary.ByteOrder

func (*DataReaderComplexDefault[T]) GetPos

func (d *DataReaderComplexDefault[T]) GetPos() uint16

func (*DataReaderComplexDefault[T]) GetReadBuffer

func (d *DataReaderComplexDefault[T]) GetReadBuffer() utils.ReadBuffer

func (*DataReaderComplexDefault[T]) PullContext

func (d *DataReaderComplexDefault[T]) PullContext(logicalName string, readerArgs ...utils.WithReaderArgs) error

func (*DataReaderComplexDefault[T]) Read

func (d *DataReaderComplexDefault[T]) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (T, error)

func (*DataReaderComplexDefault[T]) ReadComplex

func (d *DataReaderComplexDefault[T]) ReadComplex(ctx context.Context, logicalName string, supplier func(context.Context, utils.ReadBuffer) (T, error), readerArgs ...utils.WithReaderArgs) (T, error)

func (*DataReaderComplexDefault[T]) SetByteOrder

func (d *DataReaderComplexDefault[T]) SetByteOrder(byteOrder binary.ByteOrder)

func (*DataReaderComplexDefault[T]) SetPos

func (d *DataReaderComplexDefault[T]) SetPos(pos uint16)

type DataReaderEnum

type DataReaderEnum[T any] interface {
	DataReader[T]
	Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (T, error)
}

type DataReaderEnumDefault

type DataReaderEnumDefault[T any, I any] struct {
	// contains filtered or unexported fields
}

func NewDataReaderEnumDefault

func NewDataReaderEnumDefault[T any, I any](enumResolver func(I) (T, bool), dataReader DataReader[I]) *DataReaderEnumDefault[T, I]

func ReadEnum

func ReadEnum[T any, I any](enumResolver func(I) (T, bool), dataReader DataReader[I]) *DataReaderEnumDefault[T, I]

func (*DataReaderEnumDefault[T, I]) CloseContext

func (d *DataReaderEnumDefault[T, I]) CloseContext(logicalName string, readerArgs ...utils.WithReaderArgs) error

func (*DataReaderEnumDefault[T, I]) GetByteOrder

func (d *DataReaderEnumDefault[T, I]) GetByteOrder() binary.ByteOrder

func (*DataReaderEnumDefault[T, I]) GetPos

func (d *DataReaderEnumDefault[T, I]) GetPos() uint16

func (*DataReaderEnumDefault[T, I]) GetReadBuffer

func (d *DataReaderEnumDefault[T, I]) GetReadBuffer() utils.ReadBuffer

func (*DataReaderEnumDefault[T, I]) PullContext

func (d *DataReaderEnumDefault[T, I]) PullContext(logicalName string, readerArgs ...utils.WithReaderArgs) error

func (*DataReaderEnumDefault[T, I]) Read

func (d *DataReaderEnumDefault[T, I]) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (T, error)

func (*DataReaderEnumDefault[T, I]) SetByteOrder

func (d *DataReaderEnumDefault[T, I]) SetByteOrder(byteOrder binary.ByteOrder)

func (*DataReaderEnumDefault[T, I]) SetPos

func (d *DataReaderEnumDefault[T, I]) SetPos(pos uint16)

type DataReaderSimpleBase

type DataReaderSimpleBase[T any] struct {
	// contains filtered or unexported fields
}

func NewDataReaderSimpleBase

func NewDataReaderSimpleBase[T any](readBuffer utils.ReadBuffer, bitLength uint) *DataReaderSimpleBase[T]

func (*DataReaderSimpleBase[T]) CloseContext

func (d *DataReaderSimpleBase[T]) CloseContext(logicalName string, readerArgs ...utils.WithReaderArgs) error

func (*DataReaderSimpleBase[T]) GetByteOrder

func (d *DataReaderSimpleBase[T]) GetByteOrder() binary.ByteOrder

func (*DataReaderSimpleBase[T]) GetPos

func (d *DataReaderSimpleBase[T]) GetPos() uint16

func (*DataReaderSimpleBase[T]) GetReadBuffer

func (d *DataReaderSimpleBase[T]) GetReadBuffer() utils.ReadBuffer

func (*DataReaderSimpleBase[T]) PullContext

func (d *DataReaderSimpleBase[T]) PullContext(logicalName string, readerArgs ...utils.WithReaderArgs) error

func (*DataReaderSimpleBase[T]) SetByteOrder

func (d *DataReaderSimpleBase[T]) SetByteOrder(byteOrder binary.ByteOrder)

func (*DataReaderSimpleBase[T]) SetPos

func (d *DataReaderSimpleBase[T]) SetPos(pos uint16)

type DataReaderSimpleBaseContract

type DataReaderSimpleBaseContract[T any] interface {
	utils.ByteOrderAware
	codegen.PositionMover
	ContextReader
	GetReadBuffer() utils.ReadBuffer
}

DataReaderSimpleBaseContract is a DataReader minus the Read method.

type DataReaderSimpleBigDecimal

type DataReaderSimpleBigDecimal struct {
	*DataReaderSimpleBase[*big.Float]
}

func NewDataReaderSimpleBigDecimal

func NewDataReaderSimpleBigDecimal(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleBigDecimal

func (*DataReaderSimpleBigDecimal) Read

func (d *DataReaderSimpleBigDecimal) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (*big.Float, error)

type DataReaderSimpleBoolean

type DataReaderSimpleBoolean struct {
	*DataReaderSimpleBase[bool]
}

func NewDataReaderSimpleBoolean

func NewDataReaderSimpleBoolean(readBuffer utils.ReadBuffer) *DataReaderSimpleBoolean

func (*DataReaderSimpleBoolean) Read

func (d *DataReaderSimpleBoolean) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (bool, error)

type DataReaderSimpleByte

type DataReaderSimpleByte struct {
	*DataReaderSimpleBase[byte]
}

func NewDataReaderSimpleByte

func NewDataReaderSimpleByte(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleByte

func (*DataReaderSimpleByte) Read

func (d *DataReaderSimpleByte) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (byte, error)

type DataReaderSimpleByteArray

type DataReaderSimpleByteArray struct {
	*DataReaderSimpleBase[[]byte]
}

func NewDataReaderSimpleByteArray

func NewDataReaderSimpleByteArray(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleByteArray

func (*DataReaderSimpleByteArray) Read

func (d *DataReaderSimpleByteArray) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) ([]byte, error)

type DataReaderSimpleDate

type DataReaderSimpleDate struct {
	*DataReaderSimpleBase[time.Time]
}

func NewDataReaderSimpleDate

func NewDataReaderSimpleDate(readBuffer utils.ReadBuffer) *DataReaderSimpleDate

func (*DataReaderSimpleDate) Read

func (d *DataReaderSimpleDate) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (time.Time, error)

type DataReaderSimpleDateTime

type DataReaderSimpleDateTime struct {
	*DataReaderSimpleBase[time.Time]
}

func NewDataReaderSimpleDateTime

func NewDataReaderSimpleDateTime(readBuffer utils.ReadBuffer) *DataReaderSimpleDateTime

func (*DataReaderSimpleDateTime) Read

func (d *DataReaderSimpleDateTime) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (time.Time, error)

type DataReaderSimpleDouble

type DataReaderSimpleDouble struct {
	*DataReaderSimpleBase[float64]
}

func NewDataReaderSimpleDouble

func NewDataReaderSimpleDouble(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleDouble

func (*DataReaderSimpleDouble) Read

func (d *DataReaderSimpleDouble) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (float64, error)

type DataReaderSimpleFloat

type DataReaderSimpleFloat struct {
	*DataReaderSimpleBase[float32]
}

func NewDataReaderSimpleFloat

func NewDataReaderSimpleFloat(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleFloat

func (*DataReaderSimpleFloat) Read

func (d *DataReaderSimpleFloat) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (float32, error)

type DataReaderSimpleSignedBigInteger

type DataReaderSimpleSignedBigInteger struct {
	*DataReaderSimpleBase[*big.Int]
}

func NewDataReaderSimpleSignedBigInteger

func NewDataReaderSimpleSignedBigInteger(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleSignedBigInteger

func (*DataReaderSimpleSignedBigInteger) Read

func (d *DataReaderSimpleSignedBigInteger) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (*big.Int, error)

type DataReaderSimpleSignedByte

type DataReaderSimpleSignedByte struct {
	*DataReaderSimpleBase[int8]
}

func NewDataReaderSimpleSignedByte

func NewDataReaderSimpleSignedByte(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleSignedByte

func (*DataReaderSimpleSignedByte) Read

func (d *DataReaderSimpleSignedByte) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (int8, error)

type DataReaderSimpleSignedInt

type DataReaderSimpleSignedInt struct {
	*DataReaderSimpleBase[int32]
}

func NewDataReaderSimpleSignedInt

func NewDataReaderSimpleSignedInt(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleSignedInt

func (*DataReaderSimpleSignedInt) Read

func (d *DataReaderSimpleSignedInt) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (int32, error)

type DataReaderSimpleSignedLong

type DataReaderSimpleSignedLong struct {
	*DataReaderSimpleBase[int64]
}

func NewDataReaderSimpleSignedLong

func NewDataReaderSimpleSignedLong(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleSignedLong

func (*DataReaderSimpleSignedLong) Read

func (d *DataReaderSimpleSignedLong) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (int64, error)

type DataReaderSimpleSignedShort

type DataReaderSimpleSignedShort struct {
	*DataReaderSimpleBase[int16]
}

func NewDataReaderSimpleSignedShort

func NewDataReaderSimpleSignedShort(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleSignedShort

func (*DataReaderSimpleSignedShort) Read

func (d *DataReaderSimpleSignedShort) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (int16, error)

type DataReaderSimpleString

type DataReaderSimpleString struct {
	*DataReaderSimpleBase[string]
}

func NewDataReaderSimpleString

func NewDataReaderSimpleString(readBuffer utils.ReadBuffer, bitLength uint32) *DataReaderSimpleString

func (*DataReaderSimpleString) Read

func (d *DataReaderSimpleString) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (string, error)

type DataReaderSimpleTime

type DataReaderSimpleTime struct {
	*DataReaderSimpleBase[time.Time]
}

func NewDataReaderSimpleTime

func NewDataReaderSimpleTime(readBuffer utils.ReadBuffer) *DataReaderSimpleTime

func (*DataReaderSimpleTime) Read

func (d *DataReaderSimpleTime) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (time.Time, error)

type DataReaderSimpleUnsignedBigInteger

type DataReaderSimpleUnsignedBigInteger struct {
	*DataReaderSimpleBase[*big.Int]
}

func NewDataReaderSimpleUnsignedBigInteger

func NewDataReaderSimpleUnsignedBigInteger(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleUnsignedBigInteger

func (*DataReaderSimpleUnsignedBigInteger) Read

func (d *DataReaderSimpleUnsignedBigInteger) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (*big.Int, error)

type DataReaderSimpleUnsignedByte

type DataReaderSimpleUnsignedByte struct {
	*DataReaderSimpleBase[uint8]
}

func NewDataReaderSimpleUnsignedByte

func NewDataReaderSimpleUnsignedByte(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleUnsignedByte

func (*DataReaderSimpleUnsignedByte) Read

func (d *DataReaderSimpleUnsignedByte) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (uint8, error)

type DataReaderSimpleUnsignedInt

type DataReaderSimpleUnsignedInt struct {
	*DataReaderSimpleBase[uint32]
}

func NewDataReaderSimpleUnsignedInt

func NewDataReaderSimpleUnsignedInt(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleUnsignedInt

func (*DataReaderSimpleUnsignedInt) Read

func (d *DataReaderSimpleUnsignedInt) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (uint32, error)

type DataReaderSimpleUnsignedLong

type DataReaderSimpleUnsignedLong struct {
	*DataReaderSimpleBase[uint64]
}

func NewDataReaderSimpleUnsignedLong

func NewDataReaderSimpleUnsignedLong(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleUnsignedLong

func (*DataReaderSimpleUnsignedLong) Read

func (d *DataReaderSimpleUnsignedLong) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (uint64, error)

type DataReaderSimpleUnsignedShort

type DataReaderSimpleUnsignedShort struct {
	*DataReaderSimpleBase[uint16]
}

func NewDataReaderSimpleUnsignedShort

func NewDataReaderSimpleUnsignedShort(readBuffer utils.ReadBuffer, bitLength uint8) *DataReaderSimpleUnsignedShort

func (*DataReaderSimpleUnsignedShort) Read

func (d *DataReaderSimpleUnsignedShort) Read(ctx context.Context, logicalName string, readerArgs ...utils.WithReaderArgs) (uint16, error)

type DataWriter

type DataWriter[T any] interface {
	utils.ByteOrderAware
	ContextWriter
	Write(ctx context.Context, logicalName string, value T, writerArgs ...utils.WithWriterArgs) error
	GetWriteBuffer() utils.WriteBuffer
}

func WriteBoolean

func WriteBoolean(writeBuffer utils.WriteBuffer) DataWriter[bool]

func WriteByte

func WriteByte(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[byte]

func WriteByteArray

func WriteByteArray(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[[]byte]

func WriteDate

func WriteDate(writeBuffer utils.WriteBuffer) DataWriter[time.Time]

func WriteDateTime

func WriteDateTime(writeBuffer utils.WriteBuffer) DataWriter[time.Time]

func WriteDouble

func WriteDouble(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[float64]

func WriteFloat

func WriteFloat(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[float32]

func WriteSignedBigInteger

func WriteSignedBigInteger(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[*big.Int]

func WriteSignedByte

func WriteSignedByte(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[int8]

func WriteSignedInt

func WriteSignedInt(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[int32]

func WriteSignedLong

func WriteSignedLong(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[int64]

func WriteSignedShort

func WriteSignedShort(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[int16]

func WriteString

func WriteString(writeBuffer utils.WriteBuffer, bitLength int32) DataWriter[string]

func WriteTime

func WriteTime(writeBuffer utils.WriteBuffer) DataWriter[time.Time]

func WriteUnsignedBigInteger

func WriteUnsignedBigInteger(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[*big.Int]

func WriteUnsignedByte

func WriteUnsignedByte(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[uint8]

func WriteUnsignedInt

func WriteUnsignedInt(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[uint32]

func WriteUnsignedLong

func WriteUnsignedLong(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[uint64]

func WriteUnsignedShort

func WriteUnsignedShort(writeBuffer utils.WriteBuffer, bitLength uint8) DataWriter[uint16]

type DataWriterComplex

type DataWriterComplex[T any] interface {
	DataWriter[T]
}

type DataWriterComplexDefault

type DataWriterComplexDefault[T spi.Message] struct {
	// contains filtered or unexported fields
}

func NewDataWriterComplexDefault

func NewDataWriterComplexDefault[T spi.Message](writeBuffer utils.WriteBuffer) *DataWriterComplexDefault[T]

func WriteComplex

func WriteComplex[T spi.Message](writeBuffer utils.WriteBuffer) *DataWriterComplexDefault[T]

func (*DataWriterComplexDefault[T]) GetByteOrder

func (d *DataWriterComplexDefault[T]) GetByteOrder() binary.ByteOrder

func (*DataWriterComplexDefault[T]) GetWriteBuffer

func (d *DataWriterComplexDefault[T]) GetWriteBuffer() utils.WriteBuffer

func (*DataWriterComplexDefault[T]) PopContext

func (d *DataWriterComplexDefault[T]) PopContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterComplexDefault[T]) PushContext

func (d *DataWriterComplexDefault[T]) PushContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterComplexDefault[T]) SetByteOrder

func (d *DataWriterComplexDefault[T]) SetByteOrder(byteOrder binary.ByteOrder)

func (*DataWriterComplexDefault[T]) Write

func (d *DataWriterComplexDefault[T]) Write(ctx context.Context, logicalName string, value T, writerArgs ...utils.WithWriterArgs) error

type DataWriterDataIoDefault

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

func NewDataWriterDataIoDefault

func NewDataWriterDataIoDefault(writeBuffer utils.WriteBuffer, serializer func(utils.WriteBuffer, values.PlcValue) error) *DataWriterDataIoDefault

func WriteDataIO

func WriteDataIO[T spi.Message](writeBuffer utils.WriteBuffer, serializer func(utils.WriteBuffer, values.PlcValue) error) *DataWriterDataIoDefault

func (*DataWriterDataIoDefault) GetByteOrder

func (d *DataWriterDataIoDefault) GetByteOrder() binary.ByteOrder

func (*DataWriterDataIoDefault) GetWriteBuffer

func (d *DataWriterDataIoDefault) GetWriteBuffer() utils.WriteBuffer

func (*DataWriterDataIoDefault) PopContext

func (d *DataWriterDataIoDefault) PopContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterDataIoDefault) PushContext

func (d *DataWriterDataIoDefault) PushContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterDataIoDefault) SetByteOrder

func (d *DataWriterDataIoDefault) SetByteOrder(byteOrder binary.ByteOrder)

func (*DataWriterDataIoDefault) Write

func (d *DataWriterDataIoDefault) Write(ctx context.Context, logicalName string, value values.PlcValue, writerArgs ...utils.WithWriterArgs) error

type DataWriterEnum

type DataWriterEnum[T any] interface {
	Write(ctx context.Context, logicalName string, value T, writerArgs ...utils.WithWriterArgs) error
}

type DataWriterEnumDefault

type DataWriterEnumDefault[T any, I any] struct {
	// contains filtered or unexported fields
}

func NewDataWriterEnumDefault

func NewDataWriterEnumDefault[T any, I any](enumSerializer func(T) I, enumNamer func(T) string, dataWriter DataWriter[I]) *DataWriterEnumDefault[T, I]

func WriteEnum

func WriteEnum[T any, I any](enumSerializer func(T) I, enumNamer func(T) string, dataWriter DataWriter[I]) *DataWriterEnumDefault[T, I]

func (*DataWriterEnumDefault[T, I]) GetByteOrder

func (d *DataWriterEnumDefault[T, I]) GetByteOrder() binary.ByteOrder

func (*DataWriterEnumDefault[T, I]) GetWriteBuffer

func (d *DataWriterEnumDefault[T, I]) GetWriteBuffer() utils.WriteBuffer

func (*DataWriterEnumDefault[T, I]) PopContext

func (d *DataWriterEnumDefault[T, I]) PopContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterEnumDefault[T, I]) PushContext

func (d *DataWriterEnumDefault[T, I]) PushContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterEnumDefault[T, I]) SetByteOrder

func (d *DataWriterEnumDefault[T, I]) SetByteOrder(byteOrder binary.ByteOrder)

func (*DataWriterEnumDefault[T, I]) Write

func (d *DataWriterEnumDefault[T, I]) Write(ctx context.Context, logicalName string, value T, writerArgs ...utils.WithWriterArgs) error

type DataWriterSimpleBase

type DataWriterSimpleBase[T any] struct {
	WriteBuffer utils.WriteBuffer
	// contains filtered or unexported fields
}

func NewDataWriterSimpleBase

func NewDataWriterSimpleBase[T any](WriteBuffer utils.WriteBuffer, bitLength uint) *DataWriterSimpleBase[T]

func (*DataWriterSimpleBase[T]) GetByteOrder

func (d *DataWriterSimpleBase[T]) GetByteOrder() binary.ByteOrder

func (*DataWriterSimpleBase[T]) GetWriteBuffer

func (d *DataWriterSimpleBase[T]) GetWriteBuffer() utils.WriteBuffer

func (*DataWriterSimpleBase[T]) PopContext

func (d *DataWriterSimpleBase[T]) PopContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterSimpleBase[T]) PushContext

func (d *DataWriterSimpleBase[T]) PushContext(logicalName string, writerArgs ...utils.WithWriterArgs) error

func (*DataWriterSimpleBase[T]) SetByteOrder

func (d *DataWriterSimpleBase[T]) SetByteOrder(byteOrder binary.ByteOrder)

type DataWriterSimpleBaseContract

type DataWriterSimpleBaseContract[T any] interface {
	utils.ByteOrderAware
	ContextWriter
	GetWriteBuffer() utils.WriteBuffer
}

DataWriterSimpleBaseContract is a DataWriter minus the Read method.

type DataWriterSimpleBigDecimal

type DataWriterSimpleBigDecimal struct {
	*DataWriterSimpleBase[*big.Float]
}

func NewDataWriterSimpleBigDecimal

func NewDataWriterSimpleBigDecimal(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleBigDecimal

func (*DataWriterSimpleBigDecimal) Write

func (d *DataWriterSimpleBigDecimal) Write(ctx context.Context, logicalName string, value *big.Float, args ...utils.WithWriterArgs) error

type DataWriterSimpleBoolean

type DataWriterSimpleBoolean struct {
	*DataWriterSimpleBase[bool]
}

func NewDataWriterSimpleBoolean

func NewDataWriterSimpleBoolean(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleBoolean

func (*DataWriterSimpleBoolean) Write

func (d *DataWriterSimpleBoolean) Write(ctx context.Context, logicalName string, value bool, args ...utils.WithWriterArgs) error

type DataWriterSimpleByte

type DataWriterSimpleByte struct {
	*DataWriterSimpleBase[byte]
}

func NewDataWriterSimpleByte

func NewDataWriterSimpleByte(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleByte

func (*DataWriterSimpleByte) Write

func (d *DataWriterSimpleByte) Write(ctx context.Context, logicalName string, value byte, args ...utils.WithWriterArgs) error

type DataWriterSimpleByteArrayAA

type DataWriterSimpleByteArrayAA struct {
	*DataWriterSimpleBase[[]byte]
}

func NewDataWriterSimpleByteArray

func NewDataWriterSimpleByteArray(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleByteArrayAA

func (*DataWriterSimpleByteArrayAA) Write

func (d *DataWriterSimpleByteArrayAA) Write(ctx context.Context, logicalName string, value []byte, args ...utils.WithWriterArgs) error

type DataWriterSimpleDate

type DataWriterSimpleDate struct {
	*DataWriterSimpleBase[time.Time]
}

func NewDataWriterSimpleDate

func NewDataWriterSimpleDate(WritBuffer utils.WriteBuffer) *DataWriterSimpleDate

func (*DataWriterSimpleDate) Write

func (d *DataWriterSimpleDate) Write(ctx context.Context, logicalName string, value time.Time, args ...utils.WithWriterArgs) error

type DataWriterSimpleDateTime

type DataWriterSimpleDateTime struct {
	*DataWriterSimpleBase[time.Time]
}

func NewDataWriterSimpleDateTime

func NewDataWriterSimpleDateTime(WritBuffer utils.WriteBuffer) *DataWriterSimpleDateTime

func (*DataWriterSimpleDateTime) Write

func (d *DataWriterSimpleDateTime) Write(ctx context.Context, logicalName string, value time.Time, args ...utils.WithWriterArgs) error

type DataWriterSimpleDouble

type DataWriterSimpleDouble struct {
	*DataWriterSimpleBase[float64]
}

func NewDataWriterSimpleDouble

func NewDataWriterSimpleDouble(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleDouble

func (*DataWriterSimpleDouble) Write

func (d *DataWriterSimpleDouble) Write(ctx context.Context, logicalName string, value float64, args ...utils.WithWriterArgs) error

type DataWriterSimpleFloat

type DataWriterSimpleFloat struct {
	*DataWriterSimpleBase[float32]
}

func NewDataWriterSimpleFloat

func NewDataWriterSimpleFloat(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleFloat

func (*DataWriterSimpleFloat) Write

func (d *DataWriterSimpleFloat) Write(ctx context.Context, logicalName string, value float32, args ...utils.WithWriterArgs) error

type DataWriterSimpleSignedBigInteger

type DataWriterSimpleSignedBigInteger struct {
	*DataWriterSimpleBase[*big.Int]
}

func NewDataWriterSimpleSignedBigInteger

func NewDataWriterSimpleSignedBigInteger(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleSignedBigInteger

func (*DataWriterSimpleSignedBigInteger) Write

func (d *DataWriterSimpleSignedBigInteger) Write(ctx context.Context, logicalName string, value *big.Int, args ...utils.WithWriterArgs) error

type DataWriterSimpleSignedByte

type DataWriterSimpleSignedByte struct {
	*DataWriterSimpleBase[int8]
}

func NewDataWriterSimpleSignedByte

func NewDataWriterSimpleSignedByte(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleSignedByte

func (*DataWriterSimpleSignedByte) Write

func (d *DataWriterSimpleSignedByte) Write(ctx context.Context, logicalName string, value int8, args ...utils.WithWriterArgs) error

type DataWriterSimpleSignedInt

type DataWriterSimpleSignedInt struct {
	*DataWriterSimpleBase[int32]
}

func NewDataWriterSimpleSignedInt

func NewDataWriterSimpleSignedInt(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleSignedInt

func (*DataWriterSimpleSignedInt) Write

func (d *DataWriterSimpleSignedInt) Write(ctx context.Context, logicalName string, value int32, args ...utils.WithWriterArgs) error

type DataWriterSimpleSignedLong

type DataWriterSimpleSignedLong struct {
	*DataWriterSimpleBase[int64]
}

func NewDataWriterSimpleSignedLong

func NewDataWriterSimpleSignedLong(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleSignedLong

func (*DataWriterSimpleSignedLong) Write

func (d *DataWriterSimpleSignedLong) Write(ctx context.Context, logicalName string, value int64, args ...utils.WithWriterArgs) error

type DataWriterSimpleSignedShort

type DataWriterSimpleSignedShort struct {
	*DataWriterSimpleBase[int16]
}

func NewDataWriterSimpleSignedShort

func NewDataWriterSimpleSignedShort(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleSignedShort

func (*DataWriterSimpleSignedShort) Write

func (d *DataWriterSimpleSignedShort) Write(ctx context.Context, logicalName string, value int16, args ...utils.WithWriterArgs) error

type DataWriterSimpleString

type DataWriterSimpleString struct {
	*DataWriterSimpleBase[string]
}

func NewDataWriterSimpleString

func NewDataWriterSimpleString(WritBuffer utils.WriteBuffer, bitLength int32) *DataWriterSimpleString

func (*DataWriterSimpleString) Write

func (d *DataWriterSimpleString) Write(ctx context.Context, logicalName string, value string, args ...utils.WithWriterArgs) error

type DataWriterSimpleTime

type DataWriterSimpleTime struct {
	*DataWriterSimpleBase[time.Time]
}

func NewDataWriterSimpleTime

func NewDataWriterSimpleTime(WritBuffer utils.WriteBuffer) *DataWriterSimpleTime

func (*DataWriterSimpleTime) Write

func (d *DataWriterSimpleTime) Write(ctx context.Context, logicalName string, value time.Time, args ...utils.WithWriterArgs) error

type DataWriterSimpleUnsignedBigInteger

type DataWriterSimpleUnsignedBigInteger struct {
	*DataWriterSimpleBase[*big.Int]
}

func NewDataWriterSimpleUnsignedBigInteger

func NewDataWriterSimpleUnsignedBigInteger(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleUnsignedBigInteger

func (*DataWriterSimpleUnsignedBigInteger) Write

func (d *DataWriterSimpleUnsignedBigInteger) Write(ctx context.Context, logicalName string, value *big.Int, args ...utils.WithWriterArgs) error

type DataWriterSimpleUnsignedByte

type DataWriterSimpleUnsignedByte struct {
	*DataWriterSimpleBase[uint8]
}

func NewDataWriterSimpleUnsignedByte

func NewDataWriterSimpleUnsignedByte(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleUnsignedByte

func (*DataWriterSimpleUnsignedByte) Write

func (d *DataWriterSimpleUnsignedByte) Write(ctx context.Context, logicalName string, value uint8, args ...utils.WithWriterArgs) error

type DataWriterSimpleUnsignedInt

type DataWriterSimpleUnsignedInt struct {
	*DataWriterSimpleBase[uint32]
}

func NewDataWriterSimpleUnsignedInt

func NewDataWriterSimpleUnsignedInt(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleUnsignedInt

func (*DataWriterSimpleUnsignedInt) Write

func (d *DataWriterSimpleUnsignedInt) Write(ctx context.Context, logicalName string, value uint32, args ...utils.WithWriterArgs) error

type DataWriterSimpleUnsignedLong

type DataWriterSimpleUnsignedLong struct {
	*DataWriterSimpleBase[uint64]
}

func NewDataWriterSimpleUnsignedLong

func NewDataWriterSimpleUnsignedLong(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleUnsignedLong

func (*DataWriterSimpleUnsignedLong) Write

func (d *DataWriterSimpleUnsignedLong) Write(ctx context.Context, logicalName string, value uint64, args ...utils.WithWriterArgs) error

type DataWriterSimpleUnsignedShort

type DataWriterSimpleUnsignedShort struct {
	*DataWriterSimpleBase[uint16]
}

func NewDataWriterSimpleUnsignedShort

func NewDataWriterSimpleUnsignedShort(WritBuffer utils.WriteBuffer, bitLength uint8) *DataWriterSimpleUnsignedShort

func (*DataWriterSimpleUnsignedShort) Write

func (d *DataWriterSimpleUnsignedShort) Write(ctx context.Context, logicalName string, value uint16, args ...utils.WithWriterArgs) error

type ParseSupplier

type ParseSupplier[T any] interface {
	Get() (T, error)
}

Source Files

Jump to

Keyboard shortcuts

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