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

Method Encode

pgproto3/query.go:33–38  ·  view source on GitHub ↗

Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.

(dst []byte)

Source from the content-addressed store, hash-verified

31
32// Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.
33func (src *Query) Encode(dst []byte) ([]byte, error) {
34 dst, sp := beginMessage(dst, 'Q')
35 dst = append(dst, src.String...)
36 dst = append(dst, 0)
37 return finishMessage(dst, sp)
38}
39
40// MarshalJSON implements encoding/json.Marshaler.
41func (src Query) MarshalJSON() ([]byte, error) {

Callers

nothing calls this directly

Calls 2

beginMessageFunction · 0.85
finishMessageFunction · 0.85

Tested by

no test coverage detected