sshconfig

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 3 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 IsEnabled added in v1.5.1

func IsEnabled() bool

IsEnabled - checks if SSH config feature is enabled in application state.

func IsUserDefinedPath added in v1.5.0

func IsUserDefinedPath() bool

IsUserDefinedPath - checks if user re-defined SSH config file path.

func Path added in v1.5.0

func Path() string

Path - returns SSH config file path which is defined in application configuration.

func SetPath added in v1.5.0

func SetPath(path string)

SetPath - set SSH config file path. This function does not validate or refine path.

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