Documentation ¶
Index ¶
- Variables
- type Config
- type CredentialInterceptor
- type Credentials
- type Manager
- type Mode
- type Option
- func MergeOptions(lists ...[]Option) []Option
- func WithAWSAuthOnly(aws_auth_only bool) Option
- func WithClientCertificate(certPath, keyPath string) Option
- func WithCredentialInterceptor(credFactory CredentialInterceptor) Option
- func WithGeneratedClientCertificate() Option
- func WithGeneratedServerCertificate() Option
- func WithListenAddress(addr string) Option
- func WithMode(mode Mode) Option
- func WithQueryInterceptor(interceptor QueryInterceptor) Option
- func WithServerCertificate(certPath, keyPath string) Option
- type Proxy
- type QueryInterceptor
Constants ¶
This section is empty.
Variables ¶
var WillSendManually = fmt.Errorf("sending manually")
WillSendManually lets the proxy know that QueryInterceptor will handle sending the message
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ServerCertificate *tls.Certificate DefaultClientCertificate *tls.Certificate ListenAddress *net.TCPAddr CredentialInterceptor CredentialInterceptor QueryInterceptor QueryInterceptor Mode Mode AwsAuthOnly bool `default:false` }
Config contains the various options for setting up the proxy
type CredentialInterceptor ¶
type CredentialInterceptor func(creds *Credentials) error
CredentialInterceptor provides a way to update credentials being forwarded to the server proxy
type Credentials ¶
type Credentials struct { Host string Database string Username string Password string // Misc connection parameters to be passed along Options map[string]string // SSL Settings for the outbound connection SSLMode pg.SSLMode ClientCertificate *tls.Certificate RootCertificate *x509.Certificate }
Credentials represents connection details to an upstream database or proxy
type Manager ¶
Manager watches a group of proxies
func NewManager ¶
NewManager returns an instance of Manager
type Option ¶
Option lets you set a config option
func MergeOptions ¶
MergeOptions is a helper to merge an option list
func WithAWSAuthOnly ¶
func WithClientCertificate ¶
WithClientCertificate sets up the default client certificates
func WithCredentialInterceptor ¶
func WithCredentialInterceptor(credFactory CredentialInterceptor) Option
WithCredentialInterceptor sets the credential retrieval strategy
func WithGeneratedClientCertificate ¶
func WithGeneratedClientCertificate() Option
WithGeneratedClientCertificate generates the default client certificates
func WithGeneratedServerCertificate ¶
func WithGeneratedServerCertificate() Option
WithGeneratedServerCertificate generates a self-signed server certificate for the proxy
func WithListenAddress ¶
WithListenAddress sets the IP/port that the proxy will accept connections on
func WithQueryInterceptor ¶
func WithQueryInterceptor(interceptor QueryInterceptor) Option
WithQueryInterceptor adds a function for custom message handling
func WithServerCertificate ¶
WithServerCertificate sets the SSL settings for the proxy
type Proxy ¶
type Proxy struct { ID uint64 // contains filtered or unexported fields }
Proxy - Manages a Proxy connection, piping data between proxy and remote.
func (*Proxy) ParseCredentials ¶
func (p *Proxy) ParseCredentials(connectionParams map[string]string) Credentials
ParseCredentials takes connection parameters and turns them into Credentials
type QueryInterceptor ¶
type QueryInterceptor func(frontend pg.SendOnlyFrontend, backend pg.SendOnlyBackend, msg *pgproto3.Query) error
QueryInterceptor provides a way to define custom behavior for handling messages