ssh

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: GPL-3.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 (c *Config) ValidateInternal() error

func (*Config) ValidateOpenSSH

func (c *Config) ValidateOpenSSH() error

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) Run

func (s *InternalClient) Run(ctx context.Context, command string, arguments ...string) error

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) Run

func (c *OpenSSHClient) Run(ctx context.Context, command string, arguments ...string) error

func (*OpenSSHClient) TunnelPeerPort

func (c *OpenSSHClient) TunnelPeerPort() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL