framing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFrameTooLarge = errors.New("sapient frame exceeds configured maximum")
	ErrEmptyFrame    = errors.New("sapient frame length is zero")
)

Functions

func ErrorPacket

func ErrorPacket(err error) []byte

func ReadFrame

func ReadFrame(r io.Reader, maxBytes uint32) ([]byte, error)

ReadFrame reads one SAPIENT protobuf frame from a stream.

BSI Flex 335 inherits the SAPIENT TCP framing convention: each protobuf message is prefixed by a 32-bit little-endian byte length.

func WriteFrame

func WriteFrame(w io.Writer, data []byte) error

WriteFrame writes one length-prefixed SAPIENT protobuf frame.

Types

type FrameError

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

func (*FrameError) Error

func (e *FrameError) Error() string

func (*FrameError) Packet

func (e *FrameError) Packet() []byte

func (*FrameError) Unwrap

func (e *FrameError) Unwrap() error

Jump to

Keyboard shortcuts

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