pgFrame builds a framed wire-protocol message: type byte + int32 length (including itself) + body.
(msgType byte, body []byte)
| 72 | // pgFrame builds a framed wire-protocol message: type byte + int32 length |
| 73 | // (including itself) + body. |
| 74 | func pgFrame(msgType byte, body []byte) []byte { |
| 75 | frame := make([]byte, 0, 5+len(body)) |
| 76 | frame = append(frame, msgType) |
| 77 | frame = binary.BigEndian.AppendUint32(frame, uint32(4+len(body))) |
| 78 | return append(frame, body...) |
| 79 | } |
| 80 | |
| 81 | func parseFrame(stmtName, query string) []byte { |
| 82 | var body bytes.Buffer |
no outgoing calls
no test coverage detected