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