utils

package
v0.0.0-...-a35789a Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append22

func Append22(host string) string

Append22: return the host string with `:22` appended if not already present.

func NewSSHConfig

func NewSSHConfig(checkHostKey bool, knownHostsFile, privateKeyFile, remoteUser string) (ssh.ClientConfig, error)

NewSSHConfig: take in some common arguments and return an already-populated ssh.ClientConfig

func ParseHostsList

func ParseHostsList(path string, re *regexp.Regexp, formatter func(string) string) ([]string, error)

ParseHostsList: uses the provided regex and formatter to return a list of hosts. Regex interprets the first grouping as the host string to format + return.

Types

type SyncLogger

type SyncLogger struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

func (*SyncLogger) Error

func (l *SyncLogger) Error(msg string)

func (*SyncLogger) Fatal

func (l *SyncLogger) Fatal(msg string)

func (*SyncLogger) Info

func (l *SyncLogger) Info(msg string)

Jump to

Keyboard shortcuts

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