Documentation
¶
Index ¶
- type MySQLViaSSHDialer
- type Option
- func WithDBDURL(url string) Option
- func WithDBDriver(driver string) Option
- func WithKnownHostsPath(knownHostsPath string) Option
- func WithPass(sshPass string) Option
- func WithSSHKeyFile(sshKeyFile string) Option
- func WithSSHKeyPass(sshKeyPass string) Option
- func WithSSHUser(sshUser string) Option
- func WithSShHost(sshHost string) Option
- func WithSShPort(sshPort string) Option
- type PostgresViaSSHDialer
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLViaSSHDialer ¶
type MySQLViaSSHDialer struct {
// contains filtered or unexported fields
}
MySQLViaSSHDialer used to register the database connection via the ssh tunnel.
type Option ¶
type Option func(*SSHConfig)
func WithDBDURL ¶
func WithDBDriver ¶
func WithKnownHostsPath ¶
func WithSSHKeyFile ¶
func WithSSHKeyPass ¶
func WithSSHUser ¶
func WithSShHost ¶
func WithSShPort ¶
type PostgresViaSSHDialer ¶
type PostgresViaSSHDialer struct {
// contains filtered or unexported fields
}
PostgresViaSSHDialer implements the driver.Driver interface to register the connection to the database via the ssh tunnel.
func (*PostgresViaSSHDialer) Dial ¶
func (sd *PostgresViaSSHDialer) Dial(network, address string) (net.Conn, error)
func (*PostgresViaSSHDialer) DialTimeout ¶
type SSHConfig ¶
type SSHConfig struct {
// contains filtered or unexported fields
}
SSHConfig struct setup the ssh tunnel to connect with a given database.
func (*SSHConfig) SSHTunnel ¶
SSHTunnel method sets up the ssh tunnel and does a number of things: Create a ssh client config object that witht he user. Define a HostKeyCallback to ensures known ssh server is the actual server. If host key checking is ignore then any server that has the same FQDN or IP address can impersonate the actual ssh server. Define the authentication method to perform the ssh tunnel (passsword or private key). Register the ViaSSHDialer with the ssh connection as a parameter.