(opts: Record<string, string>)
| 19 | const writer = new Writer() |
| 20 | |
| 21 | const startup = (opts: Record<string, string>): Buffer => { |
| 22 | // protocol version |
| 23 | writer.addInt16(3).addInt16(0) |
| 24 | for (const key of Object.keys(opts)) { |
| 25 | writer.addCString(key).addCString(opts[key]) |
| 26 | } |
| 27 | |
| 28 | writer.addCString('client_encoding').addCString('UTF8') |
| 29 | |
| 30 | const bodyBuffer = writer.addCString('').flush() |
| 31 | // this message is sent without a code |
| 32 | |
| 33 | const length = bodyBuffer.length + 4 |
| 34 | |
| 35 | return new Writer().addInt32(length).add(bodyBuffer).flush() |
| 36 | } |
| 37 | |
| 38 | const requestSsl = (): Buffer => { |
| 39 | const response = Buffer.allocUnsafe(8) |
nothing calls this directly
no test coverage detected