mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
20 lines
377 B
Go
20 lines
377 B
Go
package postgres
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
|
|
"golang.org/x/net/proxy"
|
|
)
|
|
|
|
type PgxDialFunc = func(ctx context.Context, network string, address string) (net.Conn, error)
|
|
|
|
func newPgxDialFunc(dialer proxy.Dialer) PgxDialFunc {
|
|
dialFunc :=
|
|
func(ctx context.Context, network string, addr string) (net.Conn, error) {
|
|
return dialer.Dial(network, addr)
|
|
}
|
|
|
|
return dialFunc
|
|
}
|