MCPcopy
hub / github.com/jackc/pgx / beginMessage

Function beginMessage

pgproto3/pgproto3.go:104–109  ·  view source on GitHub ↗

beginMessage begins a new message of type t. It appends the message type and a placeholder for the message length to dst. It returns the new buffer and the position of the message length placeholder.

(dst []byte, t byte)

Source from the content-addressed store, hash-verified

102// beginMessage begins a new message of type t. It appends the message type and a placeholder for the message length to
103// dst. It returns the new buffer and the position of the message length placeholder.
104func beginMessage(dst []byte, t byte) ([]byte, int) {
105 dst = append(dst, t)
106 sp := len(dst)
107 dst = pgio.AppendInt32(dst, -1)
108 return dst, sp
109}
110
111// finishMessage finishes a message that was started with beginMessage. It computes the message length and writes it to
112// dst[sp]. If the message length is too large it returns an error. Otherwise it returns the final message buffer.

Callers 15

EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85

Calls 1

AppendInt32Function · 0.92

Tested by

no test coverage detected