parsing

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHeader

func ParseHeader(rawHead []byte, headerPtr any) (msgID int32, err error)

ParseHeader parses raw header bytes into a user-defined struct with bmux tags, and extracts the field tagged with `bmux:"msg_id"` for routing. Supports protobuf messages if headerPtr implements proto.Message.

Types

type PacketEnvelope

type PacketEnvelope struct {
	HeadLen uint8
	BodyLen uint16
	RawHead []byte
	RawBody []byte
}

func ParseEnvelope

func ParseEnvelope(conn net.Conn) (*PacketEnvelope, error)

Jump to

Keyboard shortcuts

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