Documentation
¶
Index ¶
- func ForwardPostAuth(fe *pgproto3.Frontend, client net.Conn) error
- func HandleUpstreamAuth(conn net.Conn, user, password string) (*pgproto3.Frontend, error)
- func ReadStartupMessage(conn net.Conn) (*pgproto3.StartupMessage, error)
- func SendAuthOK(conn net.Conn) error
- func SendErrorResponse(conn net.Conn, severity, code, message string)
- func WriteStartupMessage(conn net.Conn, user, database string, params map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForwardPostAuth ¶
ForwardPostAuth forwards ParameterStatus, BackendKeyData, and ReadyForQuery messages from upstream to the client. Returns when ReadyForQuery is received. The fe parameter should be the Frontend returned by HandleUpstreamAuth to share the same buffered reader.
func HandleUpstreamAuth ¶
HandleUpstreamAuth handles the authentication exchange with the upstream PostgreSQL server. Supports CleartextPassword, MD5Password, and SASL (SCRAM-SHA-256). Returns the pgproto3 Frontend so that callers (e.g. ForwardPostAuth) can continue reading from the same buffered reader.
func ReadStartupMessage ¶
func ReadStartupMessage(conn net.Conn) (*pgproto3.StartupMessage, error)
ReadStartupMessage reads the initial PG startup message from the client. Handles SSL negotiation (denies SSL, client retries with plaintext).
func SendAuthOK ¶
SendAuthOK sends AuthenticationOk to the client.
func SendErrorResponse ¶
SendErrorResponse sends a PG ErrorResponse to the client.
Types ¶
This section is empty.