Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cert ¶
type Cert struct { ClientCert tls.Certificate CACerts []*x509.Certificate RemoteAddr string Ports RemotePorts }
type CertError ¶ added in v0.7.0
type CertError struct {
// contains filtered or unexported fields
}
CertError represents a Cert operation error.
type CertSource ¶
type CertSource interface { // Cert returns the required certs needed to establish a TLS connection // from the client to the server. Cert(ctx context.Context, org, db, branch string) (*Cert, error) }
CertSource is used
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is responsible for listening to unsecured connections over a TCP localhost port and tunneling them securely over a TLS connection to a remote database instance defined by its PlanetScale unique branch identifier.
func (*Client) LocalAddr ¶
LocalAddr returns the address of the local listener. This is by default blocking and will only return if the proxy is invoked with the Run() method.
type Options ¶
type Options struct { // RemoteAddr defines the server address to tunnel local connections. By // default we connect to the remote address given by the CertSource. This // option can be used to over write it. RemoteAddr string // LocalAddr defines the address to listen for new connection LocalAddr string // Instance defines the remote DB instance to proxy new connection Instance string // MaxConnections is the maximum number of connections to establish // before refusing new connections. 0 means no limit. MaxConnections uint64 // CertSource defines the certificate source to obtain the required TLS // certificates for the client and the remote address of the server to // connect. CertSource CertSource // Logger defines which zap.Logger to use. Use it to override the default // Development logger . Useful for tests. Logger *zap.Logger }
Options are the options for creating a new Client.
type RemotePorts ¶
Click to show internal directories.
Click to hide internal directories.