Documentation
¶
Overview ¶
Package ssh provides native SSH connectivity over TLS for vers VMs.
This package implements SSH-over-TLS tunneling where SSH connections are established through a TLS connection on port 443. VMs are accessed via DNS hostnames in the format {vm-id}.vm.vers.sh.
Index ¶
- func PortToString(port int) string
- type Client
- func (c *Client) Conn(ctx context.Context) (*ssh.Client, error)
- func (c *Client) Connect(ctx context.Context) (*ssh.Client, error)
- func (c *Client) DialFunc(ctx context.Context) (func(network, addr string) (net.Conn, error), *ssh.Client, error)
- func (c *Client) Download(ctx context.Context, remotePath, localPath string, recursive bool) error
- func (c *Client) Execute(ctx context.Context, cmd string, stdout, stderr io.Writer) error
- func (c *Client) Interactive(ctx context.Context, stdin io.Reader, stdout, stderr io.Writer) error
- func (c *Client) StartSession(ctx context.Context) (*Session, error)
- func (c *Client) Upload(ctx context.Context, localPath, remotePath string, recursive bool) error
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PortToString ¶
PortToString converts a port number to string for compatibility.
Types ¶
type Client ¶ added in v0.5.4
type Client struct {
// contains filtered or unexported fields
}
Client provides native SSH connectivity over TLS.
func (*Client) Conn ¶ added in v0.5.4
Conn returns a raw SSH connection for use with SFTP. Caller is responsible for closing the returned client.
func (*Client) DialFunc ¶ added in v0.5.4
func (c *Client) DialFunc(ctx context.Context) (func(network, addr string) (net.Conn, error), *ssh.Client, error)
DialFunc returns a function that dials through the SSH connection. This can be used for port forwarding or other tunneling needs.
func (*Client) Download ¶ added in v0.5.4
Download copies a remote file or directory to the local host.
func (*Client) Interactive ¶ added in v0.5.4
Interactive runs an interactive shell session with PTY support.
func (*Client) StartSession ¶ added in v0.5.4
StartSession creates a new session for streaming command execution.
type Session ¶ added in v0.5.4
type Session struct {
// contains filtered or unexported fields
}
Session represents an active SSH session that can be used for streaming.
func (*Session) Stdin ¶ added in v0.5.4
func (s *Session) Stdin() io.WriteCloser
Stdin returns the stdin writer.