target

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: ISC Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Coalescers = map[string](func(Target) string){
	"host":     func(t Target) string { return t.Host },
	"hostname": func(t Target) string { return t.Hostname },
	"ip":       func(t Target) string { return t.IP },
}

Functions

func AssertTargetListEquals added in v0.1.3

func AssertTargetListEquals(t mock.TestingT, expected []Target, actual []Target)

func FriendlyNames added in v0.1.3

func FriendlyNames(ts []Target) []string

FriendlyNames maps Target.FriendlyName over a []Target

func SSHTargets added in v0.1.3

func SSHTargets(ts []Target) []string

SSHTargets maps Target.SSHTarget over a []Target

Types

type Target

type Target struct {
	Host          string // Used to reference the host from the outside, generally an Host
	Hostname      string // What the host calls itself
	IP            string
	User          string
	CoalesceOrder []string
}

Target describes a single machine that easyssh will operate on.

func FromString

func FromString(str string) Target

FromString creates a Target from a string description of the form [user@]<ip|fqdn>

func FromStrings added in v0.1.3

func FromStrings(targetStrings ...string) []Target

FromStrings maps FromString over...string

func (Target) FriendlyName added in v0.1.3

func (t Target) FriendlyName() string

FriendlyName returns the most descriptive name available for the target. Specifically, the first non-empty value of Hostname, Host, IP

func (Target) IsEmpty added in v0.1.3

func (t Target) IsEmpty() bool

func (Target) SSHTarget added in v0.1.3

func (t Target) SSHTarget() string

Return the first non-empty field defined in t.CoalesceOrder. Default is ["ip", "host"]

func (Target) String

func (t Target) String() string

Jump to

Keyboard shortcuts

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