sshconfig

package
v1.4.0-beta Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sshconfig contains SSH related models and methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilePath

func GetFilePath() string

func IsAlternativeFilePathDefined

func IsAlternativeFilePathDefined() bool

Types

type Config

type Config struct {
	// Values which should be extracted from 'ssh -G <hostname>' command:
	// 1. 'hostname'
	// 2. 'identityfile'
	// 3. 'port'
	// 4. 'user'
	Hostname     string
	IdentityFile string
	Port         string
	User         string
}

Config struct contains values loaded from ~/.ssh_config file.

func Parse

func Parse(config string) *Config

Parse - parses 'ssh -G <hostname> command' output and returns Config struct.

func StubConfig

func StubConfig() *Config

StubConfig - returns a stub SSH config. It is used on application startup when build application state and no hosts yet available. Consider to run real ssh process to request a config. See 'message.RunProcessLoadSSHConfig'.

Jump to

Keyboard shortcuts

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