parsing

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 10 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, using protobuf unmarshalling if applicable. For protobuf messages, it extracts the msgID from the field named "Msgid". For manual structs, it uses bmux tags, including bmux:"msg_id".

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