sshconfig

package
v0.0.0-...-15a9a0c Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package sshconfig provides functionality to parse SSH configuration and return real host information to users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveHost

func ResolveHost(addr string) (resolvedHost, resolvedProxyCommand string, err error)

ResolveHost takes an address and returns a resolved hostname based on ~/.ssh/config and /etc/ssh/ssh_config.

func ResolveHostFromFiles

func ResolveHostFromFiles(addr string, configFiles []FileParam) (resolvedHost, resolvedProxyCommand string, err error)

ResolveHostFromFiles takes an address, base directory (affects default include path) and a list of SSH configuration files and returns the resolved hostname.

Types

type FileParam

type FileParam struct {
	Path    string // The file name for the file to be read
	BaseDir string
}

FileParam specifies the input parameters for the config file to be read which include a path for the file to be read and a base directory name for search path for the included files.

Jump to

Keyboard shortcuts

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