Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Receive ¶ added in v0.5.0
Receive reads a message from Erlang via stdin. The message follows the Erlang port protocol format: - 4-byte length prefix in big-endian order - followed by the actual message content
The function returns the message content as a byte slice and any error encountered during reading. Possible errors include: - EOF if the port is closed - I/O errors from reading stdin - Message length exceeding available memory
Example:
messageBytes, err := erlgo.Receive()
if err != nil {
log.Fatal(err)
}
// Process messageBytes...
func Send ¶ added in v0.5.0
Send writes a message to Erlang via stdout following the port protocol. The message is automatically prefixed with its length as a 4-byte integer in big-endian order.
Parameters: - messageBytes: The content to be sent to Erlang
Returns an error if the write operation fails. Possible errors include: - I/O errors from writing to stdout - System errors if stdout is closed
Example:
message := []byte("hello")
err := erlgo.Send(message)
if err != nil {
log.Fatal(err)
}
Types ¶
This section is empty.