Documentation ¶
Overview ¶
Package conn contains code that supports a single pgwire proxy connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidToken = ErrorResponsef( pgerrcode.InvalidAuthorizationSpecification, "invalid JWT token")
ErrInvalidToken contains a pgwire error message.
Functions ¶
func AsErrorResponse ¶
func AsErrorResponse(err error) *pgproto3.ErrorResponse
AsErrorResponse locates a WrappedError within the given error message and returns the message. Otherwise, a generic "internal error" message will be returned.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a single proxy connection between an incoming SQL caller and the target database.
func (*Conn) IsActive ¶
IsActive returns true if the client has sent data to the target, and no ReadyForQuery message has been sent back.
func (*Conn) IsDraining ¶
IsDraining returns true if the connection has been placed into a drain mode.
type WrappedError ¶
type WrappedError struct {
*pgproto3.ErrorResponse
}
WrappedError wraps a pgwire ErrorResponse as an error.
func ErrorResponsef ¶
func ErrorResponsef(code string, format string, args ...interface{}) *WrappedError
ErrorResponsef is a convenience method to return a WrappedError with a basic ErrorResponse.