flexDecoder

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFlexDecoder

func NewFlexDecoder(lut id.TriceIDLookUp, m *sync.RWMutex, in io.Reader, endian bool) decoder.Decoder

NewFlexDecoder provides an decoder instance. l is the trice id list in slice of struct format. in is the usable reader for the input bytes. littleEndian is false on normal network order.

Types

type Flex

type Flex struct {
	decoder.DecoderData

	TriceRPC func(id.TriceID, int) (int, error)
	// contains filtered or unexported fields
}

Flex is the Decoding instance for bare encoded trices.

func (*Flex) Read

func (p *Flex) Read(b []byte) (n int, err error)

Read is the provided read method for flex decoding of next string as byte slice. It uses inner reader p.in and internal id look-up table to fill b with a string. b is a slice of bytes with a len for the max expected string size. n is the count of read bytes inside b. Read returns one trice string (optionally starting wth a channel specifier). A line can contain several trice strings.

Jump to

Keyboard shortcuts

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