sshconfig

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotFound = errors.New("file not found")
)

Functions

func ConfigFilePath

func ConfigFilePath(homeDir string) string

ConfigFilePath returns the path of the generated file should be ~/.ssh/scaleway.config

func ConfigIsIncluded

func ConfigIsIncluded(homeDir string) (bool, error)

ConfigIsIncluded checks that ssh config file is included in user's .ssh/config Default config file ~/.ssh/config should start with "Include scaleway.config"

func DefaultConfigFilePath

func DefaultConfigFilePath(homeDir string) string

DefaultConfigFilePath returns the default ssh config file path should be ~/.ssh/config

func Generate

func Generate(hosts []Host) ([]byte, error)

func IncludeConfigFile

func IncludeConfigFile(homeDir string) error

IncludeConfigFile edit default ssh config to include this package generated file ~/.ssh/config will be prepended with "Include scaleway.config"

func Save

func Save(homeDir string, hosts []Host) error

Types

type BastionHost

type BastionHost struct {
	Name    string
	Address string
	Port    uint32

	Hosts []SimpleHost
}

func (BastionHost) Config

func (b BastionHost) Config() string

type Host

type Host interface {
	Config() string
}

type SimpleHost

type SimpleHost struct {
	Name    string
	Address string
	User    string
}

func (SimpleHost) Config

func (h SimpleHost) Config() string

Jump to

Keyboard shortcuts

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