ssh

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSHAuthSockEnvVar = "SSH_AUTH_SOCK"
)

Variables

This section is empty.

Functions

func GetConfig

func GetConfig() (*ssh_config.Config, error)

func IncludeBunnyshellConfig added in v0.2.1

func IncludeBunnyshellConfig() error

func NewKV

func NewKV(paramName, paramValue string) *ssh_config.KV

func PrivateKeyFile

func PrivateKeyFile(file string) ssh.AuthMethod

func RemoveHost

func RemoveHost(cfg *ssh_config.Config, hostname string) error

func SaveConfig

func SaveConfig(cfg *ssh_config.Config) error

Types

type Endpoint

type Endpoint struct {
	Host string
	Port int
	User string
}

func NewEndpoint

func NewEndpoint(host string, port int) *Endpoint

func (*Endpoint) String

func (e *Endpoint) String() string

func (*Endpoint) WithUser

func (e *Endpoint) WithUser(user string) *Endpoint

type SSHTerminal

type SSHTerminal struct {
	Server *Endpoint
	Config *ssh.ClientConfig

	ReadyChannel chan bool
}

func NewSSHTerminal

func NewSSHTerminal(host string, port int, auth ssh.AuthMethod) *SSHTerminal

func (*SSHTerminal) Start

func (sshTerminal *SSHTerminal) Start() error

type SSHTunnel

type SSHTunnel struct {
	Local  *Endpoint
	Server *Endpoint
	Remote *Endpoint

	Config *ssh.ClientConfig

	Log *log.Logger

	ReadyChannel chan bool
	StopChannel  chan bool
	// contains filtered or unexported fields
}

func NewSSHTunnel

func NewSSHTunnel(serverHost string, serverPort int, auth ssh.AuthMethod, remoteHost string, remotePort int) *SSHTunnel

func (*SSHTunnel) Start

func (tunnel *SSHTunnel) Start() error

func (*SSHTunnel) Stop

func (tunnel *SSHTunnel) Stop()

Jump to

Keyboard shortcuts

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