Documentation
¶
Index ¶
- Variables
- func AddHostKeyToKnownHosts(host string, port string) error
- func CreateSSHServerContainer(pubKey string) (testcontainers.Container, error)
- func CreateTestConfig() (*ssh.ClientConfig, error)
- func NewSSHConn(ep config.EndpointInfo, cfg *ssh.ClientConfig) (*ssh.Client, error)
- type SSHConnConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Ep config.EndpointInfo = config.EndpointInfo{
Name: "container-node",
User: "linuxserver.io",
Host: "localhost",
Port: 2222,
PrivateKeyPath: "keys/id_rsa",
}
View Source
var ErrEmptyPrivKeyPath = errors.New("Private key path is empty")
View Source
var ErrNotSupported = errors.New("Authentication method not supported")
View Source
var ErrPrivKetFileNotFound = errors.New("Public key file was not found")
View Source
var ErrPrivateKeyParse = errors.New("Private key file could not be parsed")
Functions ¶
func AddHostKeyToKnownHosts ¶
func CreateSSHServerContainer ¶
func CreateSSHServerContainer(pubKey string) (testcontainers.Container, error)
func CreateTestConfig ¶
func CreateTestConfig() (*ssh.ClientConfig, error)
func NewSSHConn ¶
func NewSSHConn(ep config.EndpointInfo, cfg *ssh.ClientConfig) (*ssh.Client, error)
Creates a new SSH connection using the provided configuration. you need to have an SSH config. you can use the ssh.BuildConfig function in order create it.
Types ¶
type SSHConnConfig ¶
Configuration for creating an ssh connection.
func (SSHConnConfig) BuildConfig ¶
func (s SSHConnConfig) BuildConfig() (*ssh.ClientConfig, error)
BuildConfig builds a new SSH client configuration using username, and a path to the private key that the SSH server authenticates against.
Click to show internal directories.
Click to hide internal directories.