Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Name() string
// Connect establishes the SSH connection and starts the file server.
// It returns an error if the connection or server setup fails.
// You SHOULD run the Close() method even after a connection failure.
Connect(ctx context.Context) error
Close(ctx context.Context)
Run(ctx context.Context, command string, arguments ...string) error
TunnelPeerPort() int
}
type Config ¶
type Config struct {
Host string
Port int
Username string
PrivateKeyPaths []string
KnownHostsPath string
SSHConfigPath string // Path to the OpenSSH config file, if any
Handler http.Handler
ConnectTimeout time.Duration
}
Config holds the configuration to connect to the SSH server
func (*Config) ValidateInternal ¶
func (*Config) ValidateOpenSSH ¶
type InternalClient ¶
type InternalClient struct {
// contains filtered or unexported fields
}
func NewInternalClient ¶
func NewInternalClient(config Config) *InternalClient
func (*InternalClient) Close ¶
func (s *InternalClient) Close(ctx context.Context)
func (*InternalClient) Connect ¶
func (s *InternalClient) Connect(_ context.Context) error
Connect establishes the SSH connection and starts the file server. It returns an error if the connection or server setup fails. You SHOULD run the Close() method even after a connection failure.
func (*InternalClient) Name ¶
func (s *InternalClient) Name() string
func (*InternalClient) TunnelPeerPort ¶
func (s *InternalClient) TunnelPeerPort() int
type OpenSSHClient ¶
type OpenSSHClient struct {
// contains filtered or unexported fields
}
func NewOpenSSHClient ¶
func NewOpenSSHClient(config Config) *OpenSSHClient
func (*OpenSSHClient) Close ¶
func (c *OpenSSHClient) Close(ctx context.Context)
func (*OpenSSHClient) Connect ¶
func (c *OpenSSHClient) Connect(ctx context.Context) error
Connect establishes the SSH connection and starts the file server. It returns an error if the connection or server setup fails. You SHOULD run the Close() method even after a connection failure.
func (*OpenSSHClient) Name ¶
func (c *OpenSSHClient) Name() string
func (*OpenSSHClient) TunnelPeerPort ¶
func (c *OpenSSHClient) TunnelPeerPort() int
Click to show internal directories.
Click to hide internal directories.