Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Handler types.HandlerType // The handler type (1 byte) Key [32]byte // Fixed 32-byte key (e.g., Ethereum hash) Data []byte // The remaining data after the key }
Message struct represents a UDP message
func Decode ¶
Decode decodes a byte slice into a Message struct without allocating new memory for data.
func GenerateRandomMessage ¶
func GenerateRandomMessage(handler types.HandlerType) (*Message, error)
GenerateRandomMessage generates a Message with a random handler and key, and no data.
func GenerateRandomMessageWithData ¶
func GenerateRandomMessageWithData(handler types.HandlerType, data []byte) (*Message, error)
GenerateRandomMessageWithData generates a Message with a key, and a specified data payload.
Click to show internal directories.
Click to hide internal directories.