Documentation
¶
Overview ¶
Package session opens a datasource, raising an SSH tunnel first when the configuration calls for one.
It exists so that "connect to this datasource" is one step for every caller, and so the tunnel's lifetime is tied to the connection's rather than left to each command to remember.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Auth []ssh.AuthMethod
HostKeyCallback ssh.HostKeyCallback
}
Options override how the bastion is authenticated and verified.
Both default to the real thing — ssh-agent and ~/.ssh/known_hosts — and exist as fields so tests can drive the same Open path against an in-process SSH server.
type Session ¶
Session is a database connection plus the tunnel carrying it, if any.
func OpenWith ¶
func OpenWith(ctx context.Context, ds *config.DataSource, password string, opt Options) (*Session, error)
OpenWith is Open with explicit SSH credentials.
Click to show internal directories.
Click to hide internal directories.