ssh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFilePerm os.FileMode = 0644
View Source
const KnownHostsFilePerm os.FileMode = 0644
View Source
const PrivateKeyFilePerm os.FileMode = 0600

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(configFilePath string) Config

func NewConfigWithDefaultConfigFilePath

func NewConfigWithDefaultConfigFilePath() Config

func (Config) AddOrReplaceHost

func (c Config) AddOrReplaceHost(
	hostKey string,
	hostName string,
	identityFile string,
	user string,
	port int64,
) error

func (Config) RemoveHostIfExists

func (c Config) RemoveHostIfExists(hostKey string) error

func (Config) UpdateHost

func (c Config) UpdateHost(
	hostKey string,
	hostName *string,
	identityFile *string,
	user *string,
) error

type Keys

type Keys struct {
	// contains filtered or unexported fields
}

func NewKeys

func NewKeys(SSHDir string) Keys

func NewKeysWithDefaultDir

func NewKeysWithDefaultDir() Keys

func (Keys) CreateOrReplacePEM

func (k Keys) CreateOrReplacePEM(
	PEMName string,
	PEMContent string,
) (pathWritten string, err error)

func (Keys) GetPEMFilePath

func (k Keys) GetPEMFilePath(PEMName string) string

func (Keys) RemovePEMIfExists

func (k Keys) RemovePEMIfExists(PEMName string) error

type KnownHosts

type KnownHosts struct {
	// contains filtered or unexported fields
}

func NewKnownHosts

func NewKnownHosts(knownHostsFilePath string) KnownHosts

func NewKnownHostsWithDefaultKnownHostsFilePath

func NewKnownHostsWithDefaultKnownHostsFilePath() KnownHosts

func (KnownHosts) AddOrReplace

func (k KnownHosts) AddOrReplace(hostname, algorithm, fingerprint string) error

func (KnownHosts) RemoveIfExists

func (k KnownHosts) RemoveIfExists(hostname string) error

type PortForwarder

type PortForwarder struct{}

func NewPortForwarder

func NewPortForwarder() PortForwarder

func (PortForwarder) Forward

func (p PortForwarder) Forward(
	onReadyChan chan<- PortForwarderReadyResp,
	privateKeyBytes []byte,
	user string,
	serverAddr string,
	localAddr string,
	remoteAddrProtocol string,
	remoteAddr string,
) error

type PortForwarderReadyResp

type PortForwarderReadyResp struct {
	Error     error
	LocalAddr string
}

Jump to

Keyboard shortcuts

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