Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleConnection ¶
func HandleConnection(ctx context.Context, conn net.Conn, connectionFn DSNConstructor)
HandleConnection proxies a single connection.
This should be run as the first thing after accepting a connection. It will block until the connection is closed.
Types ¶
type Config ¶
type Config struct {
Listen string `name:"listen" short:"l" help:"Address to listen on." env:"FTL_PROXY_PG_LISTEN" default:"127.0.0.1:5678"`
}
type DSNConstructor ¶
DSNConstructor is a function that constructs a new connection string from parameters of the incoming connection.
parameters are pg connection parameters as described in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
type PgProxy ¶
type PgProxy struct {
// contains filtered or unexported fields
}
PgProxy is a configurable proxy for PostgreSQL connections
func New ¶
func New(listenAddress string, connectionFn DSNConstructor) *PgProxy
New creates a new PgProxy.
address is the address to listen on for incoming connections. connectionFn is a function that constructs a new connection string from parameters of the incoming connection.